Auto merge of #149887 - notriddle:stringdex/20251211, r= · rust-lang/rust@032b906 (original) (raw)
`@@ -54,6 +54,23 @@ class RoaringBitmap {
`
54
54
`}
`
55
55
`this.consumed_len_bytes = pspecial - i;
`
56
56
`return this;
`
``
57
`+
} else if (u8array[i] > 0xe0) {
`
``
58
`+
// Special representation of tiny sets that are runs
`
``
59
`+
const lspecial = u8array[i] & 0x0f;
`
``
60
`+
this.keysAndCardinalities = new Uint8Array(lspecial * 4);
`
``
61
`+
i += 1;
`
``
62
`+
const key = u8array[i + 2] | (u8array[i + 3] << 8);
`
``
63
`+
const value = u8array[i] | (u8array[i + 1] << 8);
`
``
64
`+
const container = new RoaringBitmapRun(1, new Uint8Array(4));
`
``
65
`+
container.array[0] = value & 0xFF;
`
``
66
`+
container.array[1] = (value >> 8) & 0xFF;
`
``
67
`+
container.array[2] = lspecial - 1;
`
``
68
`+
this.containers.push(container);
`
``
69
`+
this.keysAndCardinalities[0] = key & 0xFF;
`
``
70
`+
this.keysAndCardinalities[1] = (key >> 8) & 0xFF;
`
``
71
`+
this.keysAndCardinalities[2] = lspecial - 1;
`
``
72
`+
this.consumed_len_bytes = 5;
`
``
73
`+
return this;
`
57
74
`} else if (u8array[i] < 0x3a) {
`
58
75
`// Special representation of tiny sets with arbitrary 32-bit integers
`
59
76
`const lspecial = u8array[i];
`
`@@ -2282,7 +2299,7 @@ function loadDatabase(hooks) {
`
2282
2299
` */
`
2283
2300
`class InlineNeighborsTree {
`
2284
2301
`/**
`
2285
``
`-
- @param {Uint8Array} encoded
`
``
2302
`+
- @param {Uint8Array} encoded
`
2286
2303
` * @param {number} start
`
2287
2304
` */
`
2288
2305
`constructor(
`
`@@ -2654,7 +2671,7 @@ function loadDatabase(hooks) {
`
2654
2671
``
2655
2672
`/**
`
2656
2673
` * @param {string} inputBase64
`
2657
``
`-
- @returns {[Uint8Array, SearchTree]}
`
``
2674
`+
- @returns {[Uint8Array, SearchTree]}
`
2658
2675
` */
`
2659
2676
`function makeSearchTreeFromBase64(inputBase64) {
`
2660
2677
`const input = makeUint8ArrayFromBase64(inputBase64);
`
`@@ -3305,7 +3322,7 @@ if (typeof window !== "undefined") {
`
3305
3322
`// eslint-disable-next-line max-len
`
3306
3323
`// polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
`
3307
3324
`/**
`
3308
``
`-
- @type {function(string): Uint8Array} base64
`
``
3325
`+
- @type {function(string): Uint8Array} base64
`
3309
3326
` */
`
3310
3327
`//@ts-expect-error
`
3311
3328
`const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 : (string => {
`
`@@ -3318,7 +3335,7 @@ const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 :
`
3318
3335
`return bytes;
`
3319
3336
`});
`
3320
3337
`/**
`
3321
``
`-
- @type {function(string): Uint8Array} base64
`
``
3338
`+
- @type {function(string): Uint8Array} base64
`
3322
3339
` */
`
3323
3340
`//@ts-expect-error
`
3324
3341
`const makeUint8ArrayFromHex = Uint8Array.fromHex ? Uint8Array.fromHex : (string => {
`