Simplify const syntax, remove redundant map lookups in buildCells

This commit is contained in:
Ian Gulliver
2026-02-20 17:31:03 -07:00
parent 0bfa11c640
commit 7d398082dd

View File

@@ -2,9 +2,7 @@ package main
import "fmt" import "fmt"
const ( const cueTrackID = "_cue"
cueTrackID = "_cue"
)
type Show struct { type Show struct {
Tracks []*Track `json:"tracks"` Tracks []*Track `json:"tracks"`
@@ -189,11 +187,11 @@ func (tl *Timeline) findCell(blockID, event string) *TimelineCell {
func (tl *Timeline) buildCells(endChains map[string]bool) { func (tl *Timeline) buildCells(endChains map[string]bool) {
lastOnTrack := map[string]*Block{} lastOnTrack := map[string]*Block{}
for _, block := range tl.show.Blocks { for _, block := range tl.show.Blocks {
lastOnTrack[tl.Blocks[block.ID].Track] = block lastOnTrack[block.Track] = block
} }
for _, block := range tl.show.Blocks { for _, block := range tl.show.Blocks {
track := tl.trackIdx[tl.Blocks[block.ID].Track] track := tl.trackIdx[block.Track]
var cells []*TimelineCell var cells []*TimelineCell
switch block.Type { switch block.Type {
case "cue": case "cue":