lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject svn commit: r1672727 - /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java
Date Fri, 10 Apr 2015 18:57:23 GMT
Author: dsmiley
Date: Fri Apr 10 18:57:23 2015
New Revision: 1672727

URL: http://svn.apache.org/r1672727
Log:
LUCENE-5579: BitDocIdSet.Builder.isDefinitelyEmpty()

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java?rev=1672727&r1=1672726&r2=1672727&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java Fri Apr
10 18:57:23 2015
@@ -107,6 +107,15 @@ public class BitDocIdSet extends DocIdSe
     }
 
     /**
+     * Is this builder definitely empty?  If so, {@link #build()} will return null.  This
is usually the same as
+     * simply being empty but if this builder was constructed with the {@code full} option
or if an iterator was passed
+     * that iterated over no documents, then we're not sure.
+     */
+    public boolean isDefinitelyEmpty() {
+      return sparseSet == null && denseSet == null;
+    }
+
+    /**
      * Add the content of the provided {@link DocIdSetIterator} to this builder.
      */
     public void or(DocIdSetIterator it) throws IOException {



Mime
View raw message