mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core/filtermaps: using slices.SortFunc
This commit is contained in:
parent
684f0db4a2
commit
9eeb22c32d
1 changed files with 4 additions and 2 deletions
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"slices"
|
"slices"
|
||||||
"sort"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -616,7 +615,10 @@ func (fmr *filterMapsRange) addRenderedRange(firstRendered, afterLastRendered, a
|
||||||
if fmr.tailPartialEpoch > 0 {
|
if fmr.tailPartialEpoch > 0 {
|
||||||
endpoints = append(endpoints, []endpoint{{fmr.maps.First() - mapsPerEpoch, 1}, {fmr.maps.First() - mapsPerEpoch + fmr.tailPartialEpoch, -1}}...)
|
endpoints = append(endpoints, []endpoint{{fmr.maps.First() - mapsPerEpoch, 1}, {fmr.maps.First() - mapsPerEpoch + fmr.tailPartialEpoch, -1}}...)
|
||||||
}
|
}
|
||||||
sort.Slice(endpoints, func(i, j int) bool { return endpoints[i].m < endpoints[j].m })
|
slices.SortFunc(endpoints, func(a, b endpoint) int {
|
||||||
|
return int(a.m) - int(b.m)
|
||||||
|
})
|
||||||
|
|
||||||
var (
|
var (
|
||||||
sum int
|
sum int
|
||||||
merged []uint32
|
merged []uint32
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue