forked from External/ergo
use maps.Clone from go1.21
This commit is contained in:
parent
28d9a7ff63
commit
f77d430d25
5 changed files with 8 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue