lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1127247 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java
Date Tue, 24 May 2011 20:05:59 GMT
Author: mikemccand
Date: Tue May 24 20:05:59 2011
New Revision: 1127247

URL: http://svn.apache.org/viewvc?rev=1127247&view=rev
Log:
LUCENE-2972: move numBits maintenance under assert

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

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java?rev=1127247&r1=1127246&r2=1127247&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java Tue May 24 20:05:59
2011
@@ -306,7 +306,7 @@ public class OpenBitSet extends DocIdSet
       ensureCapacity(index+1);
       wlen = wordNum+1;
     }
-    numBits = Math.max(numBits, index+1);
+    assert (numBits = Math.max(numBits, index+1)) >= 0;
     return wordNum;
   }
 
@@ -693,7 +693,7 @@ public class OpenBitSet extends DocIdSet
   public void union(OpenBitSet other) {
     int newLen = Math.max(wlen,other.wlen);
     ensureCapacityWords(newLen);
-    numBits = Math.max(other.numBits, numBits);
+    assert (numBits = Math.max(other.numBits, numBits)) >= 0;
 
     long[] thisArr = this.bits;
     long[] otherArr = other.bits;
@@ -722,7 +722,7 @@ public class OpenBitSet extends DocIdSet
   public void xor(OpenBitSet other) {
     int newLen = Math.max(wlen,other.wlen);
     ensureCapacityWords(newLen);
-    numBits = Math.max(other.numBits, numBits);
+    assert (numBits = Math.max(other.numBits, numBits)) >= 0;
 
     long[] thisArr = this.bits;
     long[] otherArr = other.bits;



Mime
View raw message