v0.0.105
This commit is contained in:
parent
304e779470
commit
2f66ab1cf0
@ -15,3 +15,11 @@ func ArrToMap[T comparable, V any](a []V, keyfunc func(V) T) map[T]V {
|
|||||||
}
|
}
|
||||||
return result
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user