Skip to content

Commit

Permalink
Sort
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Dec 11, 2024
1 parent a284c7a commit 1e50ff9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd-x-index-all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math/rand"
"os"
"path/filepath"
"sort"
"time"

"github.com/dustin/go-humanize"
Expand Down Expand Up @@ -167,6 +168,10 @@ func createAllIndexes(
for kind := range numItems {
kinds = append(kinds, kind)
}
// sort from byte value:
sort.Slice(kinds, func(i, j int) bool {
return kinds[i] < kinds[j]
})
for _, kind := range kinds {
klog.Infof(" %s: %s items", iplddecoders.Kind(kind), humanize.Comma(int64(numItems[kind])))
numTotalItems += numItems[kind]
Expand Down

0 comments on commit 1e50ff9

Please sign in to comment.