mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
genbindings/util: add slice_copy helper
This commit is contained in:
parent
8d1c871de3
commit
c6381d40e8
@ -46,3 +46,11 @@ func slice_to_set[T comparable](list []T) map[T]struct{} {
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func slice_copy[T comparable](input []T) []T {
|
||||
ret := make([]T, len(input))
|
||||
for i, elem := range input {
|
||||
ret[i] = elem
|
||||
}
|
||||
return ret
|
||||
}
|
Loading…
Reference in New Issue
Block a user