lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: OpenBitSet.flip(int, int) bug, ugly one?
Date Mon, 14 Aug 2006 02:41:02 GMT
Fixed... someone put 'c' too close to 'f' on the keyboard ;-)

-    long endmask = (endIndex&0x3c)==0 ? 0 : -1L >>> (64-endIndex);
+    long endmask = (endIndex&0x3f)==0 ? 0 : -1L >>> (64-endIndex);

-Yonik


On 8/13/06, eks dev <eksdev@yahoo.co.uk> wrote:
> Hi Yonik,
>
> it seams we have another one nobody uses :)
>
> this fails:
>   public void testFlipRange() {
>     OpenBitSet b1 = new OpenBitSet(100);
>
>     b1.set(0);
>     b1.set(4);
>     b1.set(5);
>     b1.set(9);
>
>     b1.flip(0,3);
>
>     assertFalse(b1.get(0));
>     assertTrue(b1.get(1));
>     assertTrue(b1.get(2));
>   }
>
>
> but if you flip(0,5) it works
>
> cheers, e.

Mime
View raw message