Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong result with WrappedImmutableConciseBitmap#difference #40

Open
lushuifeng opened this issue Apr 9, 2018 · 0 comments
Open

wrong result with WrappedImmutableConciseBitmap#difference #40

lushuifeng opened this issue Apr 9, 2018 · 0 comments

Comments

@lushuifeng
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant