This is a recent addition and it is missing a check as the underlaying array can be smaller that the numBits capacity.
This commit is contained in:
parent
862fab06d3
commit
81645ec2cc
|
@ -66,6 +66,9 @@ public final class BitArray implements Releasable {
|
|||
|
||||
public long nextSetBit(long index) {
|
||||
long wordNum = wordNum(index);
|
||||
if (wordNum >= bits.size()) {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
long word = bits.get(wordNum) >> index; // skip all the bits to the right of index
|
||||
|
||||
if (word!=0) {
|
||||
|
|
Loading…
Reference in New Issue