Skip to content

Commit

Permalink
Pull request 1749: 5522-fix-stat-sorting
Browse files Browse the repository at this point in the history
Updates AdguardTeam#5522.

Squashed commit of the following:

commit dd3481c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Feb 21 20:14:29 2023 +0300

    stats: fix sorting
  • Loading branch information
ainar-g committed Feb 22, 2023
1 parent 76a513c commit 3a0b27e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/stats/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func convertMapToSlice(m map[string]uint64, max int) (s []countPair) {
}

slices.SortFunc(s, func(a, b countPair) (sortsBefore bool) {
return a.Count < b.Count
return a.Count > b.Count
})
if max > len(s) {
max = len(s)
Expand Down

0 comments on commit 3a0b27e

Please sign in to comment.