diff --git a/db/trie/mptrie/sortedlist.go b/db/trie/mptrie/sortedlist.go index c857f1b18b..dd95eaade3 100644 --- a/db/trie/mptrie/sortedlist.go +++ b/db/trie/mptrie/sortedlist.go @@ -1,6 +1,7 @@ package mptrie import ( + "slices" "sort" ) @@ -31,9 +32,7 @@ func (sl *SortedList) sort() { if sl.sorted { return } - sort.Slice(sl.li, func(i, j int) bool { - return sl.li[i] < sl.li[j] - }) + slices.Sort(sl.li) sl.sorted = true } diff --git a/state/factory/workingset.go b/state/factory/workingset.go index 291a35d773..7a5bd8aedc 100644 --- a/state/factory/workingset.go +++ b/state/factory/workingset.go @@ -8,7 +8,7 @@ package factory import ( "context" "math/big" - "sort" + "slices" "time" erigonstate "github.com/erigontech/erigon/core/state" @@ -455,7 +455,7 @@ func (ws *workingSet) checkNonceContinuity(ctx context.Context, accountNonceMap if err != nil { return errors.Wrapf(err, "failed to get the confirmed nonce of address %s", srcAddr) } - sort.Slice(receivedNonces, func(i, j int) bool { return receivedNonces[i] < receivedNonces[j] }) + slices.Sort(receivedNonces) if useZeroNonce { pendingNonce = confirmedState.PendingNonceConsideringFreshAccount() } else {