Skip to content

Commit 4ef5a1c

Browse files
committed
core: fix mkalloc
1 parent 1ff46a7 commit 4ef5a1c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/mkalloc.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,28 @@ import (
3030
"fmt"
3131
"math/big"
3232
"os"
33-
"sort"
3433
"strconv"
3534

3635
"github.com/ethereum/go-ethereum/core"
3736
"github.com/ethereum/go-ethereum/rlp"
37+
"golang.org/x/exp/slices"
3838
)
3939

4040
type allocItem struct{ Addr, Balance *big.Int }
4141

4242
func makelist(g *core.Genesis) []allocItem {
43-
a := make([]allocItem, 0, len(g.Alloc))
43+
items := make([]allocItem, 0, len(g.Alloc))
4444
for addr, account := range g.Alloc {
4545
if len(account.Storage) > 0 || len(account.Code) > 0 || account.Nonce != 0 {
4646
panic(fmt.Sprintf("can't encode account %x", addr))
4747
}
4848
bigAddr := new(big.Int).SetBytes(addr.Bytes())
49-
a = append(a, allocItem{bigAddr, account.Balance})
49+
items = append(items, allocItem{bigAddr, account.Balance})
5050
}
51-
slices.SortFunc(a, func(b, c allocItem) bool {
52-
return b.Addr.Cmp(c.Addr) < 0
51+
slices.SortFunc(items, func(a, b allocItem) bool {
52+
return a.Addr.Cmp(b.Addr) < 0
5353
})
54-
return a
54+
return items
5555
}
5656

5757
func makealloc(g *core.Genesis) string {

0 commit comments

Comments
 (0)