diff --git a/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java b/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java index 4ee409b7706..7d1e877474a 100644 --- a/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java +++ b/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java @@ -268,11 +268,8 @@ public class RoaringDocIdSet extends DocIdSet { Iterator() throws IOException { doc = -1; - block = 0; - while (docIdSets[block] == null) { - block += 1; - } - sub = docIdSets[block].iterator(); + block = -1; + sub = DocIdSetIterator.empty(); } @Override