|
@@ -197,7 +197,7 @@ func sortMap(unsorted *sync.Map, size int) {
|
|
|
|
|
|
sort.Slice(tempCont, func(i, j int) bool { return tempCont[i].Num > tempCont[j].Num })
|
|
|
|
|
|
- if len(tempCont) > size && size > 0 {
|
|
|
+ if size > 0 && len(tempCont) > size {
|
|
|
tempCont = tempCont[:size]
|
|
|
}
|
|
|
|