From 1b2082942a7a71ebbf43505b423b0acacff08aea Mon Sep 17 00:00:00 2001 From: maskpp Date: Tue, 25 Jun 2024 20:45:41 +0800 Subject: [PATCH] change to use slices.SortFunc --- core/txpool/blobpool/evictheap.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/txpool/blobpool/evictheap.go b/core/txpool/blobpool/evictheap.go index 74d3d9d3dc..6ac3261c63 100644 --- a/core/txpool/blobpool/evictheap.go +++ b/core/txpool/blobpool/evictheap.go @@ -17,10 +17,9 @@ package blobpool import ( - "bytes" "container/heap" "math" - "sort" + "slices" "github.com/ethereum/go-ethereum/common" "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 // test in unit tests. 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 for i, addr := range addrs {