GenericIndexIterator::SetTo(): Find fuzzily
Use TwoKeyAVLTree::FindFirstClosest() instead of FindFirst(), so, if the value isn't in the index, we find the closest greater value. That's the semantics Index::InternalFind() is expected to have.
This commit is contained in:
parent
abaf82e5a9
commit
84989de15b
@ -148,10 +148,12 @@ GenericIndexIterator<Policy>::SetTo(Index* index, const Value& value,
|
||||
return false;
|
||||
|
||||
typename NodeTree::Iterator iterator;
|
||||
if (ignoreValue)
|
||||
if (ignoreValue) {
|
||||
Policy::GetNodeTree(fIndex)->GetIterator(&iterator);
|
||||
else if (Policy::GetNodeTree(fIndex)->FindFirst(value, &iterator) == NULL)
|
||||
} else if (Policy::GetNodeTree(fIndex)->FindFirstClosest(value, false,
|
||||
&iterator) == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
fNextTreeNode = iterator.CurrentNode();
|
||||
return fNextTreeNode != NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user