jpountz commented on code in PR #14294:
URL: https://github.com/apache/lucene/pull/14294#discussion_r1971606728
##########
lucene/core/src/java/org/apache/lucene/search/ScorerUtil.java:
##########
@@ -113,22 +116,21 @@ static Scorable likelyTermScorer(Scorable scorable) {
/**
* Optimize {@link Bits} representing the set of accepted documents for the
case when it is likely
- * implemented via a {@link FixedBitSet}. This helps make calls to {@link
Bits#get(int)}
- * inlinable, which in-turn helps speed up query evaluation. This is
especially helpful as
- * inlining will sometimes enable auto-vectorizing shifts and masks that are
done in {@link
- * FixedBitSet#get(int)}.
+ * implemented as live docs. This helps make calls to {@link Bits#get(int)}
inlinable, which
+ * in-turn helps speed up query evaluation. This is especially helpful as
inlining will sometimes
+ * enable auto-vectorizing shifts and masks that are done in {@link
FixedBitSet#get(int)}.
*/
- static Bits likelyFixedBitSet(Bits acceptDocs) {
- if (acceptDocs instanceof FixedBitSet) {
+ static Bits likelyLiveDocs(Bits acceptDocs) {
+ if (acceptDocs == null) {
+ return acceptDocs;
+ } else if (acceptDocs.getClass() == DEFAULT_ACCEPT_DOCS_CLASS) {
return acceptDocs;
- } else if (acceptDocs != null) {
- return new FilterBits(acceptDocs);
} else {
- return null;
+ return new FilterBits(acceptDocs);
}
}
- private static class FilterBits implements Bits {
+ static class FilterBits implements Bits {
Review Comment:
This is because I needed it in the test, which I had failed to check in. I
have now checked it in, but your comment made me want to avoid making this
class pkg-private, so I refactored the test. This class is now private again.
--
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]