use maps.Clone from go1.21

This commit is contained in:
Shivaram Lingamneni 2023-08-15 20:57:52 -04:00
parent 28d9a7ff63
commit f77d430d25
5 changed files with 8 additions and 14 deletions

View file

@ -27,11 +27,3 @@ func SetLiteral[T comparable](elems ...T) HashSet[T] {
}
return result
}
func CopyMap[K comparable, V any](input map[K]V) (result map[K]V) {
result = make(map[K]V, len(input))
for key, value := range input {
result[key] = value
}
return
}