LUCENE-2972: move numBits maintenance under assert

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1127247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-05-24 20:05:59 +00:00
parent 5d0b7d21ae
commit a636ef94d1
1 changed files with 3 additions and 3 deletions

View File

@ -306,7 +306,7 @@ public class OpenBitSet extends DocIdSet implements Bits, Cloneable {
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 implements Bits, Cloneable {
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 implements Bits, Cloneable {
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;