mirror of https://github.com/apache/lucene.git
fix OpenBitSet.flip(start,end)
git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@431284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ed7ab7baec
commit
0a69bbbcff
|
@ -368,7 +368,7 @@ public class OpenBitSet implements Cloneable, Serializable {
|
|||
***/
|
||||
|
||||
long startmask = -1L << startIndex;
|
||||
long endmask = (endIndex&0x3c)==0 ? 0 : -1L >>> (64-endIndex);
|
||||
long endmask = (endIndex&0x3f)==0 ? 0 : -1L >>> (64-endIndex);
|
||||
|
||||
if (this.wlen <= endWord) {
|
||||
this.wlen = endWord;
|
||||
|
|
|
@ -64,6 +64,11 @@ public class TestOpenBitSet extends TestCase {
|
|||
idx = rand.nextInt(sz);
|
||||
a.flip(idx);
|
||||
b.fastFlip(idx);
|
||||
int idx1 = rand.nextInt(sz);
|
||||
int idx2 = rand.nextInt(sz);
|
||||
if (idx1>idx2) { idx=idx1; idx1=idx2; idx2=idx; }
|
||||
a.flip(idx1,idx2);
|
||||
b.flip(idx1,idx2);
|
||||
|
||||
boolean val = b.flipAndGet(idx);
|
||||
boolean val2 = b.flipAndGet(idx);
|
||||
|
|
Loading…
Reference in New Issue