Use slices.Insert instead of double-append in insertGap

This commit is contained in:
Ian Gulliver
2026-02-21 22:55:56 -08:00
parent 22dbb48b4e
commit 1178adba92

View File

@@ -1,6 +1,9 @@
package main
import "fmt"
import (
"fmt"
"slices"
)
const cueTrackID = "_cue"
@@ -377,6 +380,6 @@ func (tl *Timeline) insertGap(track *TimelineTrack, beforeIndex int) {
}
}
track.Cells = append(track.Cells[:beforeIndex], append([]*TimelineCell{gap}, track.Cells[beforeIndex:]...)...)
track.Cells = slices.Insert(track.Cells, beforeIndex, gap)
tl.reindexRowsFrom(track, beforeIndex+1)
}