mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
change to use slices.SortFunc
This commit is contained in:
parent
a4b7a65ac9
commit
1b2082942a
1 changed files with 2 additions and 3 deletions
|
|
@ -17,10 +17,9 @@
|
||||||
package blobpool
|
package blobpool
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"container/heap"
|
"container/heap"
|
||||||
"math"
|
"math"
|
||||||
"sort"
|
"slices"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
|
|
@ -56,7 +55,7 @@ func newPriceHeap(basefee *uint256.Int, blobfee *uint256.Int, index *map[common.
|
||||||
// but it makes the heap initialization deterministic and less annoying to
|
// but it makes the heap initialization deterministic and less annoying to
|
||||||
// test in unit tests.
|
// test in unit tests.
|
||||||
addrs := maps.Keys(*index)
|
addrs := maps.Keys(*index)
|
||||||
sort.Slice(addrs, func(i, j int) bool { return bytes.Compare(addrs[i][:], addrs[j][:]) < 0 })
|
slices.SortFunc(addrs, common.Address.Cmp)
|
||||||
|
|
||||||
heap.addrs = addrs
|
heap.addrs = addrs
|
||||||
for i, addr := range addrs {
|
for i, addr := range addrs {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue