@@ -112,37 +112,23 @@ private final void countAll(IndexReader reader) throws IOException {
112
112
NumericDocValues singleValued = DocValues .unwrapSingleton (multiValued );
113
113
114
114
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 ;
126
120
}
121
+ increment ((int ) singleValued .longValue ());
127
122
}
128
123
} 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 ;
135
129
}
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 ());
146
132
}
147
133
}
148
134
}
0 commit comments