Skip to content

Commit

Permalink
fix traverse order in tree iterator (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang authored Feb 1, 2023
1 parent a5366e7 commit e2ccb02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,10 @@ func (iter *NodeIterator) Next(isSkipped bool) {
iter.err = err
return
}
iter.nodesToVisit = append(iter.nodesToVisit, leftNode)
rightNode, err := iter.ndb.GetNode(node.rightHash)
if err != nil {
iter.err = err
return
}
iter.nodesToVisit = append(iter.nodesToVisit, rightNode)
iter.nodesToVisit = append(iter.nodesToVisit, rightNode, leftNode)
}

0 comments on commit e2ccb02

Please sign in to comment.