Pull request 1749: 5522-fix-stat-sorting
Updates #5522. Squashed commit of the following: commit dd3481cccf09f78fd85904cb69b9031371996f54 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Feb 21 20:14:29 2023 +0300 stats: fix sorting
This commit is contained in:
parent
76a513cdaf
commit
3a0b27e7e8
|
@ -181,7 +181,7 @@ func convertMapToSlice(m map[string]uint64, max int) (s []countPair) {
|
||||||
}
|
}
|
||||||
|
|
||||||
slices.SortFunc(s, func(a, b countPair) (sortsBefore bool) {
|
slices.SortFunc(s, func(a, b countPair) (sortsBefore bool) {
|
||||||
return a.Count < b.Count
|
return a.Count > b.Count
|
||||||
})
|
})
|
||||||
if max > len(s) {
|
if max > len(s) {
|
||||||
max = len(s)
|
max = len(s)
|
||||||
|
|
Loading…
Reference in New Issue