You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2011/05/24 22:05:59 UTC
svn commit: r1127247 -
/lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/OpenBitSet.java
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;