brettwooldridge / SparseBitSet

An efficient sparse bit set implementation for Java
Apache License 2.0
265 stars 33 forks source link

Bug in previousClearBit #15

Open incaseoftrouble opened 6 years ago

incaseoftrouble commented 6 years ago

Hi,

while testing the 1.2 version I found the following issue:

SparseBitSet set = new SparseBitSet();
set.set(0);
set.set(64);
System.out.println(set.previousClearBit(64));
set.clear(0);
set.set(1);
System.out.println(set.previousClearBit(64));

Expected: (consistent with BitSet)

63
63

Got:

-1
0

@BrentDouglas

re-thc commented 5 years ago

Hi, any chance of a new release with these fixes? Thanks.