Skip to content

Commit 4af4def

Browse files
authored
Update execute.go
1 parent cb97c48 commit 4af4def

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

triedb/pathdb/execute.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func apply(db database.NodeDatabase, prevRoot common.Hash, postRoot common.Hash,
5959
rawStorageKey: rawStorageKey,
6060
nodes: trienode.NewMergedNodeSet(),
6161
}
62-
var deletes []common.Address
62+
deletes := make([]common.Address, 0, len(accounts))
6363
for addr, account := range accounts {
6464
if len(account) == 0 {
6565
deletes = append(deletes, addr)
@@ -114,7 +114,7 @@ func updateAccount(ctx *context, db database.NodeDatabase, addr common.Address)
114114
if err != nil {
115115
return err
116116
}
117-
var deletes []common.Hash
117+
deletes := make([]common.Hash, 0, len(ctx.storages[addr]))
118118
for key, val := range ctx.storages[addr] {
119119
tkey := key
120120
if ctx.rawStorageKey {

0 commit comments

Comments
 (0)