reorderItems returns a copy now

This commit is contained in:
Siiiiinth
2026-02-15 21:06:59 +01:00
parent dccd2d8f1a
commit f7c33da085
+3 -1
View File
@@ -113,7 +113,9 @@ func TracksToIDs(tracks []*mediaprovider.Track) []string {
// idxToMove must contain only valid indexes into tracks, and no repeats
func ReorderItems[T any](items []T, idxToMove []int, insertIdx int) []T {
if len(items) < 2 {
return items
cpy := make([]T, len(items))
copy(cpy, items)
return cpy
}
idxToMoveSet := ToSet(idxToMove)