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
|
return decodeErr
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Close()
|
|
||||||
var thumbImg *image.NRGBA
|
var thumbImg *image.NRGBA
|
||||||
|
|
||||||
if width == 0 || height == 0 {
|
if width == 0 || height == 0 {
|
||||||
|
|
|
@ -23,13 +23,14 @@ func (s *Store[T]) Reset(newData map[string]T) {
|
||||||
s.mux.Lock()
|
s.mux.Lock()
|
||||||
defer s.mux.Unlock()
|
defer s.mux.Unlock()
|
||||||
|
|
||||||
var clone = make(map[string]T, len(newData))
|
if len(newData) > 0 {
|
||||||
|
s.data = make(map[string]T, len(newData))
|
||||||
for k, v := range newData {
|
for k, v := range newData {
|
||||||
clone[k] = v
|
s.data[k] = v
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
s.data = make(map[string]T)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.data = clone
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Length returns the current number of elements in the store.
|
// Length returns the current number of elements in the store.
|
||||||
|
|
Loading…
Reference in New Issue