diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-18 20:54:35 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-18 20:54:35 +0200 |
| commit | cd554b0af706b5f62b4e1bfde04091052b4aac61 (patch) | |
| tree | e6d02f1c2a1da27da17386e8832c2d4a3e699cdf /internal/tui/dashboard/icicle.go | |
| parent | b421b2232351049277ee4ad5b31367bb2b6779bb (diff) | |
cleanup
Diffstat (limited to 'internal/tui/dashboard/icicle.go')
| -rw-r--r-- | internal/tui/dashboard/icicle.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/tui/dashboard/icicle.go b/internal/tui/dashboard/icicle.go index 92c4834..768783b 100644 --- a/internal/tui/dashboard/icicle.go +++ b/internal/tui/dashboard/icicle.go @@ -1,10 +1,11 @@ package dashboard import ( + "cmp" "fmt" "math" "path/filepath" - "sort" + "slices" "strings" "ior/internal/statsengine" @@ -169,13 +170,13 @@ func sortedIcicleChildren(node *icicleNode, metric bubbleMetric) []*icicleNode { for _, child := range node.children { out = append(out, child) } - sort.Slice(out, func(i, j int) bool { - vi := icicleValue(out[i], metric) - vj := icicleValue(out[j], metric) - if vi != vj { - return vi > vj + slices.SortFunc(out, func(a, b *icicleNode) int { + va := icicleValue(a, metric) + vb := icicleValue(b, metric) + if va != vb { + return cmp.Compare(vb, va) } - return out[i].name < out[j].name + return cmp.Compare(a.name, b.name) }) return out } |
