add fix for II

This commit is contained in:
fjy 2014-03-10 12:01:49 -07:00
parent 1f62257ac2
commit 2db73998b9
1 changed files with 8 additions and 10 deletions

View File

@ -241,6 +241,10 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter
if (numAdvanced == -1) { if (numAdvanced == -1) {
numAdvanced = 0; numAdvanced = 0;
} else {
Iterators.advance(baseIter, numAdvanced);
}
while (baseIter.hasNext()) { while (baseIter.hasNext()) {
currEntry.set(baseIter.next()); currEntry.set(baseIter.next());
if (filterMatcher.matches()) { if (filterMatcher.matches()) {
@ -249,12 +253,6 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter
numAdvanced++; numAdvanced++;
} }
} else {
Iterators.advance(baseIter, numAdvanced);
if (baseIter.hasNext()) {
currEntry.set(baseIter.next());
}
}
done = cursorMap.size() == 0 || !baseIter.hasNext(); done = cursorMap.size() == 0 || !baseIter.hasNext();