You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2015/04/10 21:00:46 UTC
svn commit: r1672729 - in /lucene/dev/branches/branch_5x: ./ lucene/
lucene/core/ lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java
Author: dsmiley
Date: Fri Apr 10 19:00:46 2015
New Revision: 1672729
URL: http://svn.apache.org/r1672729
Log:
LUCENE-5579: BitDocIdSet.Builder.isDefinitelyEmpty()
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/lucene/ (props changed)
lucene/dev/branches/branch_5x/lucene/core/ (props changed)
lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java
Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java?rev=1672729&r1=1672728&r2=1672729&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/BitDocIdSet.java Fri Apr 10 19:00:46 2015
@@ -113,6 +113,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 {