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:
parent
41dcd9b4d4
commit
cdfc1f7b70
@ -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 {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user