diff --git a/core/state/snapshot/iterator_binary.go b/core/state/snapshot/iterator_binary.go index 6d17d37759..41d96be429 100644 --- a/core/state/snapshot/iterator_binary.go +++ b/core/state/snapshot/iterator_binary.go @@ -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 } } diff --git a/core/state/snapshot/iterator_test.go b/core/state/snapshot/iterator_test.go index c6c6d4928d..f2f4d19f83 100644 --- a/core/state/snapshot/iterator_test.go +++ b/core/state/snapshot/iterator_test.go @@ -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) - }) }) }