shubhamsrkdev commented on code in PR #16282:
URL: https://github.com/apache/lucene/pull/16282#discussion_r3466577911
##########
lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java:
##########
@@ -867,6 +867,10 @@ public static FixedBitSet copyOf(Bits bits) {
if (bits instanceof FixedBitSet fbs) {
return fbs.clone();
+ } else if (bits instanceof DenseLiveDocs denseLiveDocs) {
+ return denseLiveDocs.toFixedBitSet();
+ } else if (bits instanceof SparseLiveDocs sparseLiveDocs) {
+ return sparseLiveDocs.toFixedBitSet();
Review Comment:
I think either way is fine - if it leads to a reduction of `instanceof` in,
not a huge fan of it (if it keeps on branching)
##########
lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java:
##########
@@ -867,6 +867,10 @@ public static FixedBitSet copyOf(Bits bits) {
if (bits instanceof FixedBitSet fbs) {
return fbs.clone();
+ } else if (bits instanceof DenseLiveDocs denseLiveDocs) {
+ return denseLiveDocs.toFixedBitSet();
+ } else if (bits instanceof SparseLiveDocs sparseLiveDocs) {
+ return sparseLiveDocs.toFixedBitSet();
Review Comment:
I think either way is fine - if it leads to a reduction of `instanceof`, not
a huge fan of it (if it keeps on branching)
--
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]