Skip to content

wrong result with WrappedImmutableConciseBitmap#difference #40

Description

@lushuifeng

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions