modernize: Use maps.Copy instead of for loops

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-12-15 18:18:12 +01:00
parent ff33808a79
commit cdce8f4f92
28 changed files with 66 additions and 123 deletions

View File

@@ -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{}
}