Skip to content

Commit cfc6e54

Browse files
committed
revert part of LUCENE-10350 that got missed in the earlier revert
1 parent 90ce59e commit cfc6e54

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

lucene/facet/src/java/org/apache/lucene/facet/taxonomy/FastTaxonomyFacetCounts.java

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -112,37 +112,23 @@ private final void countAll(IndexReader reader) throws IOException {
112112
NumericDocValues singleValued = DocValues.unwrapSingleton(multiValued);
113113

114114
if (singleValued != null) {
115-
if (liveDocs == null) {
116-
while (singleValued.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
117-
increment((int) singleValued.longValue());
118-
}
119-
} else {
120-
for (int doc = singleValued.nextDoc();
121-
doc != DocIdSetIterator.NO_MORE_DOCS;
122-
doc = singleValued.nextDoc()) {
123-
if (liveDocs.get(doc)) {
124-
increment((int) singleValued.longValue());
125-
}
115+
for (int doc = singleValued.nextDoc();
116+
doc != DocIdSetIterator.NO_MORE_DOCS;
117+
doc = singleValued.nextDoc()) {
118+
if (liveDocs != null && liveDocs.get(doc) == false) {
119+
continue;
126120
}
121+
increment((int) singleValued.longValue());
127122
}
128123
} else {
129-
if (liveDocs == null) {
130-
while (multiValued.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
131-
final int dvCount = multiValued.docValueCount();
132-
for (int i = 0; i < dvCount; i++) {
133-
increment((int) multiValued.nextValue());
134-
}
124+
for (int doc = multiValued.nextDoc();
125+
doc != DocIdSetIterator.NO_MORE_DOCS;
126+
doc = multiValued.nextDoc()) {
127+
if (liveDocs != null && liveDocs.get(doc) == false) {
128+
continue;
135129
}
136-
} else {
137-
for (int doc = multiValued.nextDoc();
138-
doc != DocIdSetIterator.NO_MORE_DOCS;
139-
doc = multiValued.nextDoc()) {
140-
if (liveDocs.get(doc)) {
141-
final int dvCount = multiValued.docValueCount();
142-
for (int i = 0; i < dvCount; i++) {
143-
increment((int) multiValued.nextValue());
144-
}
145-
}
130+
for (int i = 0; i < multiValued.docValueCount(); i++) {
131+
increment((int) multiValued.nextValue());
146132
}
147133
}
148134
}

0 commit comments

Comments
 (0)