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/flamegraph/trie.go | |
| parent | b421b2232351049277ee4ad5b31367bb2b6779bb (diff) | |
cleanup
Diffstat (limited to 'internal/flamegraph/trie.go')
| -rw-r--r-- | internal/flamegraph/trie.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/flamegraph/trie.go b/internal/flamegraph/trie.go index 022b846..d7790c2 100644 --- a/internal/flamegraph/trie.go +++ b/internal/flamegraph/trie.go @@ -1,6 +1,9 @@ package flamegraph -import "sort" +import ( + "cmp" + "slices" +) type trieNode struct { name string @@ -35,8 +38,8 @@ func (t *trie) computeTotals() { t.maxDepth = depth } - sort.Slice(node.children, func(i, j int) bool { - return node.children[i].name < node.children[j].name + slices.SortFunc(node.children, func(a, b *trieNode) int { + return cmp.Compare(a.name, b.name) }) total := node.value |
