summaryrefslogtreecommitdiff
path: root/internal/flamegraph/trie.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-18 20:54:35 +0200
committerPaul Buetow <paul@buetow.org>2026-03-18 20:54:35 +0200
commitcd554b0af706b5f62b4e1bfde04091052b4aac61 (patch)
treee6d02f1c2a1da27da17386e8832c2d4a3e699cdf /internal/flamegraph/trie.go
parentb421b2232351049277ee4ad5b31367bb2b6779bb (diff)
cleanup
Diffstat (limited to 'internal/flamegraph/trie.go')
-rw-r--r--internal/flamegraph/trie.go9
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