Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Commit c6cd831

Browse files
roveneliahgbalint
authored andcommitted
trie: golint iterator fixes (#16639)
1 parent 66e23ce commit c6cd831

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

trie/iterator.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func (it *nodeIterator) push(state *nodeIteratorState, parentIndex *int, path []
303303
it.path = path
304304
it.stack = append(it.stack, state)
305305
if parentIndex != nil {
306-
*parentIndex += 1
306+
*parentIndex++
307307
}
308308
}
309309

@@ -380,7 +380,7 @@ func (it *differenceIterator) Next(bool) bool {
380380
if !it.b.Next(true) {
381381
return false
382382
}
383-
it.count += 1
383+
it.count++
384384

385385
if it.eof {
386386
// a has reached eof, so we just return all elements from b
@@ -395,7 +395,7 @@ func (it *differenceIterator) Next(bool) bool {
395395
it.eof = true
396396
return true
397397
}
398-
it.count += 1
398+
it.count++
399399
case 1:
400400
// b is before a
401401
return true
@@ -405,12 +405,12 @@ func (it *differenceIterator) Next(bool) bool {
405405
if !it.b.Next(hasHash) {
406406
return false
407407
}
408-
it.count += 1
408+
it.count++
409409
if !it.a.Next(hasHash) {
410410
it.eof = true
411411
return true
412412
}
413-
it.count += 1
413+
it.count++
414414
}
415415
}
416416
}
@@ -504,14 +504,14 @@ func (it *unionIterator) Next(descend bool) bool {
504504
skipped := heap.Pop(it.items).(NodeIterator)
505505
// Skip the whole subtree if the nodes have hashes; otherwise just skip this node
506506
if skipped.Next(skipped.Hash() == common.Hash{}) {
507-
it.count += 1
507+
it.count++
508508
// If there are more elements, push the iterator back on the heap
509509
heap.Push(it.items, skipped)
510510
}
511511
}
512512

513513
if least.Next(descend) {
514-
it.count += 1
514+
it.count++
515515
heap.Push(it.items, least)
516516
}
517517

0 commit comments

Comments
 (0)