fix(package): [list] preserve source storage during merge (#391)

This commit is contained in:
Yusuf Efe authored and GitHub committed 2026-10-22 10:47:25 +08:00
1 parent fe4c81a677
commit febd1030af
2 files changed
+20 -2

No files matched your search

+2 -2
View File
@@ -239,8 +239,8 @@ func (l *List[T]) Merge(other *List[T]) *List[T] {
l1, l2 := len(l.data), len(other.data)
ml := NewList(make([]T, l1+l2))
data := append([]T{}, append(l.data, other.data...)...)
ml.data = data
copy(ml.data, l.data)
copy(ml.data[l1:], other.data)
return ml
}