BPlusTree: Fix fCurrentKey in backward TreeIterator traversal.

When reaching the next node the current key should be set to the next
valid index within that node (0 for forward and NumKeys() - 1 for
backward). This did not cause any harm as BFS uses forward traversal
only.
This commit is contained in:
Michael Lotz
2013-05-02 23:26:05 +02:00
parent 50ef2db4a8
commit 8a43cad2ef
@@ -2715,7 +2715,7 @@ TreeIterator::Traverse(int8 direction, void* key, uint16* keyLength,
RETURN_ERROR(B_ERROR);
// reset current key
fCurrentKey = forward ? 0 : node->NumKeys();
fCurrentKey = forward ? 0 : node->NumKeys() - 1;
} else {
// there are no nodes left, so turn back to the last key
fCurrentNodeOffset = savedNodeOffset;