SOLR-8170: fix DocSetBuilder not removing doc 0 if it was deleted

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1709499 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2015-10-20 01:12:57 +00:00
parent 27c07ec8e3
commit 0fe5ab3b9b
1 changed files with 8 additions and 13 deletions

View File

@ -165,22 +165,17 @@ public final class DocSetBuilder {
}
private static int dedup(int[] arr, int length, FixedBitSet acceptDocs) {
if (length == 0) {
return 0;
}
int l = 1;
int previous = arr[0];
for (int i = 1; i < length; ++i) {
int pos = 0;
int previous = -1;
for (int i = 0; i < length; ++i) {
final int value = arr[i];
assert value >= previous;
if (value != previous) {
if (acceptDocs == null || acceptDocs.get(value)) {
arr[l++] = value;
previous = value;
}
// assert value >= previous;
if (value != previous && (acceptDocs == null || acceptDocs.get(value))) {
arr[pos++] = value;
previous = value;
}
}
return l;
return pos;
}