mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
modernize: Use maps.Copy instead of for loops
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package labelstore
|
||||
|
||||
import (
|
||||
"maps"
|
||||
"sync"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
@@ -40,9 +41,7 @@ func (s *InMemory) Update(dgst digest.Digest, update map[string]string) (map[str
|
||||
if !ok {
|
||||
labels = map[string]string{}
|
||||
}
|
||||
for k, v := range update {
|
||||
labels[k] = v
|
||||
}
|
||||
maps.Copy(labels, update)
|
||||
if s.labels == nil {
|
||||
s.labels = map[digest.Digest]map[string]string{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user