mirror of https://github.com/apache/lucene.git
replace 'if' with 'assert' to eek performance in BitVector.get
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@740806 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
80b471b0cc
commit
8846fd359e
|
@ -99,9 +99,7 @@ public final class BitVector implements Cloneable {
|
|||
/** Returns <code>true</code> if <code>bit</code> is one and
|
||||
<code>false</code> if it is zero. */
|
||||
public final boolean get(int bit) {
|
||||
if (bit >= size) {
|
||||
throw new ArrayIndexOutOfBoundsException(bit);
|
||||
}
|
||||
assert bit >= 0 && bit < size: "bit " + bit + " is out of bounds 0.." + (size-1);
|
||||
return (bits[bit >> 3] & (1 << (bit & 7))) != 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue