Skip to content

Commit

Permalink
Use lo.Keys
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswine committed Jul 26, 2022
1 parent 75e1468 commit fccfa67
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/querier/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"

"github.com/cespare/xxhash/v2"
"github.com/samber/lo"

ingestv1 "github.com/grafana/fire/pkg/gen/ingester/v1"
"github.com/grafana/fire/pkg/model"
Expand Down Expand Up @@ -142,10 +143,7 @@ func mergeStacktraces(profiles []profileWithSymbols) []stacktraces {
stacktrace.value += st.Value
}
}
ids := make([]uint64, 0, len(stacktracesByID))
for id := range stacktracesByID {
ids = append(ids, id)
}
ids := lo.Keys(stacktracesByID)
sort.Slice(ids, func(i, j int) bool {
return ids[i] < ids[j]
})
Expand Down

0 comments on commit fccfa67

Please sign in to comment.