diff --git a/internal/tui/components/anim/anim.go b/internal/tui/components/anim/anim.go index 016165313008e5d46875de3f02a9ea0dde016894..3a7b615f6b09a7b8c3a6fac5909cccc6eccb4bb3 100644 --- a/internal/tui/components/anim/anim.go +++ b/internal/tui/components/anim/anim.go @@ -226,14 +226,15 @@ func (a anim) ID() string { } func (a *anim) updateChars(chars *[]cyclingChar) { - for i, c := range *chars { + charSlice := *chars // dereference to avoid repeated pointer access + for i, c := range charSlice { switch c.state(a.start) { case charInitialState: - (*chars)[i].currentValue = '.' + charSlice[i].currentValue = '.' case charCyclingState: - (*chars)[i].currentValue = c.randomRune() + charSlice[i].currentValue = c.randomRune() case charEndOfLifeState: - (*chars)[i].currentValue = c.finalValue + charSlice[i].currentValue = c.finalValue } } }