Skip to content

Commit

Permalink
return correct iterator in mutable tree
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Mar 3, 2022
1 parent fe90684 commit 69be583
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ func (t *MutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped b
// Iterator returns an iterator over the mutable tree.
// CONTRACT: no updates are made to the tree while an iterator is active.
func (t *MutableTree) Iterator(start, end []byte, ascending bool) dbm.Iterator {
return NewUnsavedFastIterator(start, end, ascending, t.ndb, t.unsavedFastNodeAdditions, t.unsavedFastNodeRemovals)
if t.IsFastCacheEnabled() {
return NewUnsavedFastIterator(start, end, ascending, t.ndb, t.unsavedFastNodeAdditions, t.unsavedFastNodeRemovals)
}
return t.ImmutableTree.Iterator(start, end, ascending)
}

func (tree *MutableTree) set(key []byte, value []byte) (orphans []*Node, updated bool) {
Expand Down

0 comments on commit 69be583

Please sign in to comment.