mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +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).
|
// becomes stale and garbage collected).
|
||||||
func (it *binaryIterator) Next() bool {
|
func (it *binaryIterator) Next() bool {
|
||||||
for {
|
for {
|
||||||
ok := it.next()
|
if !it.next() {
|
||||||
if !ok {
|
return false
|
||||||
return ok
|
|
||||||
}
|
}
|
||||||
if len(it.Account()) == 0 && len(it.Slot()) == 0 {
|
if len(it.Account()) == 0 && len(it.Slot()) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return ok
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -567,7 +567,6 @@ func TestAccountIteratorFlattening(t *testing.T) {
|
||||||
t.Run("binary", func(t *testing.T) {
|
t.Run("binary", func(t *testing.T) {
|
||||||
testAccountIteratorFlattening(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
testAccountIteratorFlattening(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
||||||
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -769,7 +768,6 @@ func TestAccountIteratorDeletions(t *testing.T) {
|
||||||
t.Run("binary", func(t *testing.T) {
|
t.Run("binary", func(t *testing.T) {
|
||||||
testAccountIteratorDeletions(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
testAccountIteratorDeletions(t, func(snaps *Tree, root, seek common.Hash) AccountIterator {
|
||||||
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
return snaps.layers[root].(*diffLayer).newBinaryAccountIterator(seek)
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue