This commit is contained in:
Mike Schwörer 2023-04-23 19:31:48 +02:00
parent 304e779470
commit 2f66ab1cf0
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -15,3 +15,11 @@ func ArrToMap[T comparable, V any](a []V, keyfunc func(V) T) map[T]V {
}
return result
}
func CopyMap[K comparable, V any](a map[K]V) map[K]V {
result := make(map[K]V, len(a))
for k, v := range a {
result[k] = v
}
return result
}