list-type.go: use of copy() for copying lists
This commit is contained in:
parent
93dac956fb
commit
340b99bad7
@ -26,9 +26,10 @@ func newList(listAny []any) (list *ListType) {
|
||||
func NewList(listAny []any) (list *ListType) {
|
||||
if listAny != nil {
|
||||
ls := make(ListType, len(listAny))
|
||||
for i, item := range listAny {
|
||||
ls[i] = item
|
||||
}
|
||||
// for i, item := range listAny {
|
||||
// ls[i] = item
|
||||
// }
|
||||
copy(ls, listAny)
|
||||
list = &ls
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user