1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-09 01:17:51 +02:00

removed unnecessary Close call and formatted map hints

This commit is contained in:
Gani Georgiev 2023-12-04 16:22:49 +02:00
parent 41dcd9b4d4
commit cdfc1f7b70
2 changed files with 7 additions and 7 deletions

View File

@ -425,7 +425,6 @@ func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) err
return decodeErr
}
r.Close()
var thumbImg *image.NRGBA
if width == 0 || height == 0 {

View File

@ -23,13 +23,14 @@ func (s *Store[T]) Reset(newData map[string]T) {
s.mux.Lock()
defer s.mux.Unlock()
var clone = make(map[string]T, len(newData))
for k, v := range newData {
clone[k] = v
if len(newData) > 0 {
s.data = make(map[string]T, len(newData))
for k, v := range newData {
s.data[k] = v
}
} else {
s.data = make(map[string]T)
}
s.data = clone
}
// Length returns the current number of elements in the store.