Skip to content

Commit a409510

Browse files
committed
Remove unused specStyle in visualizer
Replaced by specWrap long ago — flagged by deadcode and staticcheck. Updated the two doc comments that referenced it to point at specWrap instead. Skipped applog.Debug and applog.Error: also unused per deadcode but they're part of the package's documented Debug/Info/Warn/Error facade and meant to be reachable as the codebase grows.
1 parent c430f58 commit a409510

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

ui/visualizer.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -863,18 +863,6 @@ func fracBlock(level, rowBottom, rowTop float64) string {
863863
return " "
864864
}
865865

866-
// specStyle returns the spectrum color style for a given row height (0-1).
867-
func specStyle(rowBottom float64) lipgloss.Style {
868-
switch {
869-
case rowBottom >= 0.6:
870-
return specHighStyle
871-
case rowBottom >= 0.3:
872-
return specMidStyle
873-
default:
874-
return specLowStyle
875-
}
876-
}
877-
878866
// scatterHash returns a pseudo-random value in [0, 1) for a given dot position
879867
// and frame. Dots persist for a few frames to create a twinkling effect.
880868
func scatterHash(band, row, col int, frame uint64) float64 {
@@ -888,7 +876,7 @@ func scatterHash(band, row, col int, frame uint64) float64 {
888876
}
889877

890878
// specTag returns 0, 1, or 2 identifying the spectrum color tier for style-run
891-
// batching. Mirrors the thresholds in specStyle.
879+
// batching, using the same thresholds as specWrap.
892880
func specTag(norm float64) int {
893881
if norm >= 0.6 {
894882
return 2
@@ -900,9 +888,8 @@ func specTag(norm float64) int {
900888
}
901889

902890
// specWrap wraps body in the cached ANSI sequences for the spectrum color at
903-
// the given row-bottom (0-1). Equivalent visual output to
904-
// `specStyle(rowBottom).Render(body)` but in one string concatenation instead
905-
// of the several allocations lipgloss performs per call.
891+
// the given row-bottom (0-1). One string concatenation instead of the several
892+
// allocations a per-call lipgloss.Style.Render would perform.
906893
func specWrap(rowBottom float64, body string) string {
907894
var prefix, suffix string
908895
switch specTag(rowBottom) {

0 commit comments

Comments
 (0)