wrong result with WrappedImmutableConciseBitmap#difference
lushuifeng opened this issue · comments
Alex lu commented
here is the sample code, the result should be [0,2] which is not
BitmapFactory bitmapFactory = new ConciseBitmapFactory();
MutableBitmap bitmap = bitmapFactory.makeEmptyMutableBitmap();
for (int i = 0; i < 3; ++i) {
bitmap.add(i);
}
MutableBitmap diff = bitmapFactory.makeEmptyMutableBitmap();
diff.add(1);
ImmutableBitmap result = bitmapFactory.makeImmutableBitmap(bitmap).difference(bitmapFactory.makeImmutableBitmap(diff));
System.out.println(result);
the result is correct with using RoaringBitmapFactory or MutableBitmap
BitmapFactory bitmapFactory = new ConciseBitmapFactory();
MutableBitmap bitmap = bitmapFactory.makeEmptyMutableBitmap();
for (int i = 0; i < 3; ++i) {
bitmap.add(i);
}
MutableBitmap diff = bitmapFactory.makeEmptyMutableBitmap();
diff.add(1);
ImmutableBitmap result = bitmap.difference(diff);
System.out.println(result);
May I create a pr to fix this? thanks