Skip to content

Commit

Permalink
core/state/snapshot: less copy
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Mar 12, 2021
1 parent 79dfa8d commit a5d6d56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/state/snapshot/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,13 @@ func (dl *diskLayer) proveRange(root common.Hash, tr *trie.SecureTrie, prefix []
if len(key) != len(prefix)+common.HashLength {
continue
}
last = common.CopyBytes(key[len(prefix):])
keys = append(keys, common.CopyBytes(key[len(prefix):]))
vals = append(vals, common.CopyBytes(iter.Value()))
}
iter.Release()

if len(keys) > 0 {
last = keys[len(keys)-1]
}
if onValue != nil {
// If an onValue callback is specified, use it to convert the values
for i, key := range keys {
Expand Down

0 comments on commit a5d6d56

Please sign in to comment.