michaeljmarshall commented on code in PR #16623:
URL: https://github.com/apache/lucene/pull/16623#discussion_r3925881498


##########
lucene/core/src/java/org/apache/lucene/util/SparseLiveDocs.java:
##########
@@ -144,6 +144,21 @@ public int deletedCount() {
     return deletedCount;
   }
 
+  @Override
+  public FixedBitSet toFixedBitSet() {
+    FixedBitSet result = new FixedBitSet(maxDoc);
+    result.set(0, maxDoc);
+    for (int del = deletedDocs.nextSetBit(0);
+        del != DocIdSetIterator.NO_MORE_DOCS;
+        del =
+            del + 1 >= maxDoc
+                ? DocIdSetIterator.NO_MORE_DOCS
+                : deletedDocs.nextSetBit(del + 1)) {
+      result.clear(del);
+    }

Review Comment:
   Note: I expect we'll get an additional speed up when we merge 
https://github.com/apache/lucene/pull/16593 by replacing this with 
`applyMask(result, 0);` because that implementation goes by word. That can be 
handled in a follow up though.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to