Browse Source

REPORT-55330 修复Bitmap实现bug

feature/10.0
loy 3 years ago
parent
commit
be3d8758f3
  1. 4
      fine-roaringbitmap/src/main/java/com/fr/third/bitmap/roaringbitmap/RoaringBitmap.java

4
fine-roaringbitmap/src/main/java/com/fr/third/bitmap/roaringbitmap/RoaringBitmap.java

@ -65,7 +65,7 @@ public class RoaringBitmap {
int lenDiff = 0;
if (sIdx1 > 0) {
byte b = value[sIdx0 - 1];
byte b2 = (byte) (~(b & 0xff) >> sIdx1 << sIdx1 + ((b & 0xff) << (32 - sIdx1) >> (32 - sIdx1)));
byte b2 = (byte) (b ^ (0xff - (int) Math.pow(2, eIdx1) + 1));
value[sIdx0 - 1] = b2;
lenDiff += countInByte(b2) - countInByte(b);
}
@ -75,7 +75,7 @@ public class RoaringBitmap {
}
if (eIdx1 > 0) {
byte b = value[eIdx0];
byte b2 = (byte) (((b & 0xff) >> eIdx1 << eIdx1) + ~(b & 0xff) << (32 - eIdx1) >> (32 - eIdx1));
byte b2 = (byte) (b ^ ((int) Math.pow(2, eIdx1) - 1));
value[eIdx0] = b2;
lenDiff += countInByte(b2) - countInByte(b);
}

Loading…
Cancel
Save