mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 02:48:12 +08:00
fix latent crossfilter bug (#1162)
This commit is contained in:
@@ -183,3 +183,24 @@ describe("fillBySelection", () => {
|
|||||||
expect(arr).toEqual(truth);
|
expect(arr).toEqual(truth);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("wide bitarray", () => {
|
||||||
|
test.each([9, 30, 31, 32, 33, 54, 63, 64, 65, 127, 128, 129])(
|
||||||
|
"more than %d dimensions",
|
||||||
|
ndim => {
|
||||||
|
/* ensure we move across the uint boundary correctly */
|
||||||
|
|
||||||
|
const ba = new BitArray(defaultTestLength);
|
||||||
|
expect(ba).toBeDefined();
|
||||||
|
|
||||||
|
for (let i = 0; i < ndim; i += 1) {
|
||||||
|
expect(ba.allocDimension()).toEqual(i);
|
||||||
|
}
|
||||||
|
ba.freeDimension(0);
|
||||||
|
expect(ba.allocDimension()).toEqual(0);
|
||||||
|
|
||||||
|
ba.freeDimension(ndim - 1);
|
||||||
|
expect(ba.allocDimension()).toEqual(ndim - 1);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class BitArray {
|
|||||||
if (lowestZeroBit) {
|
if (lowestZeroBit) {
|
||||||
this.bitmask[col] |= lowestZeroBit;
|
this.bitmask[col] |= lowestZeroBit;
|
||||||
dim = 32 * col + BitArray.ctz(lowestZeroBit);
|
dim = 32 * col + BitArray.ctz(lowestZeroBit);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dim;
|
return dim;
|
||||||
|
|||||||
Reference in New Issue
Block a user