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:
Ainar Garipov 2023-02-22 12:13:07 +03:00
parent 76a513cdaf
commit 3a0b27e7e8
1 changed files with 1 additions and 1 deletions

View File

@ -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)