Expressions now support function definition
This commit is contained in:
@@ -101,3 +101,15 @@ func anyFloat(v any) (float float64, ok bool) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CopyMap[K comparable, V any](dest, source map[K]V) map[K]V {
|
||||
for k, v := range source {
|
||||
dest[k] = v
|
||||
}
|
||||
return dest
|
||||
}
|
||||
|
||||
func CloneMap[K comparable, V any](source map[K]V) map[K]V {
|
||||
dest := make(map[K]V, len(source))
|
||||
return CopyMap(dest, source)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user