mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
core/state/snapshot: polishes
This commit is contained in:
parent
5fcf093668
commit
1b0705e2f5
2 changed files with 3 additions and 6 deletions
|
|
@ -118,14 +118,13 @@ func (dl *diffLayer) initBinaryStorageIterator(account, seek common.Hash) Iterat
|
|||
// becomes stale and garbage collected).
|
||||
func (it *binaryIterator) Next() bool {
|
||||
for {
|
||||
ok := it.next()
|
||||
if !ok {
|
||||
return ok
|
||||
if !it.next() {
|
||||
return false
|
||||
}
|
||||
if len(it.Account()) == 0 && len(it.Slot()) == 0 {
|
||||
continue
|
||||
}
|
||||
return ok
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -567,7 +567,6 @@ func TestAccountIteratorFlattening(t *testing.T) {
|
|||
t.Run("binary", func(t *testing.T) {
|
||||
testAccountIteratorFlattening(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
||||
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
@ -769,7 +768,6 @@ func TestAccountIteratorDeletions(t *testing.T) {
|
|||
t.Run("binary", func(t *testing.T) {
|
||||
testAccountIteratorDeletions(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
||||
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue