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/files.go | |
| parent | b421b2232351049277ee4ad5b31367bb2b6779bb (diff) | |
cleanup
Diffstat (limited to 'internal/tui/dashboard/files.go')
| -rw-r--r-- | internal/tui/dashboard/files.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/tui/dashboard/files.go b/internal/tui/dashboard/files.go index f24c87c..df850ab 100644 --- a/internal/tui/dashboard/files.go +++ b/internal/tui/dashboard/files.go @@ -1,9 +1,9 @@ package dashboard import ( + "cmp" "path/filepath" "slices" - "sort" "strconv" "ior/internal/statsengine" @@ -425,11 +425,11 @@ func aggregateFilesByDir(files []statsengine.FileSnapshot) []DirSnapshot { out = append(out, s) } - sort.Slice(out, func(i, j int) bool { - if out[i].Accesses != out[j].Accesses { - return out[i].Accesses > out[j].Accesses + slices.SortFunc(out, func(a, b DirSnapshot) int { + if a.Accesses != b.Accesses { + return cmp.Compare(b.Accesses, a.Accesses) } - return out[i].Dir < out[j].Dir + return cmp.Compare(a.Dir, b.Dir) }) return out } |
