Skip to content

Commit e63a5ad

Browse files
committed
up
1 parent 7585841 commit e63a5ad

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5358,7 +5358,7 @@ dependencies = [
53585358
[[package]]
53595359
name = "stringdex"
53605360
version = "0.0.3"
5361-
source = "git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514"
5361+
source = "git+https://gitlab.com/notriddle/stringdex?rev=1f8709f128425508223f95eaf14d9813803704ce#1f8709f128425508223f95eaf14d9813803704ce"
53625362
dependencies = [
53635363
"stacker",
53645364
]

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rustdoc-json-types = { path = "../rustdoc-json-types" }
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
2323
smallvec = "1.8.1"
24-
stringdex = { git = "https://gitlab.com/notriddle/stringdex", rev = "563240a4ffa22b57db94eda48a94652925a4f514" }
24+
stringdex = { git = "https://gitlab.com/notriddle/stringdex", rev = "1f8709f128425508223f95eaf14d9813803704ce" }
2525
tempfile = "3"
2626
threadpool = "1.8.1"
2727
tracing = "0.1"

src/librustdoc/html/static/js/stringdex.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,35 @@ class RoaringBitmap {
7171
this.keysAndCardinalities[2] = lspecial - 1;
7272
this.consumed_len_bytes = 5;
7373
return this;
74+
} else if (u8array[i] > 0xd0) {
75+
// Special representation of tiny sets that are close together
76+
const lspecial = u8array[i] & 0x0f;
77+
this.keysAndCardinalities = new Uint8Array(lspecial * 4);
78+
let pspecial = i + 1;
79+
let key = u8array[pspecial + 2] | (u8array[pspecial + 3] << 8);
80+
let value = u8array[pspecial] | (u8array[pspecial + 1] << 8);
81+
let entry = (key << 16) | value;
82+
let container;
83+
container = new RoaringBitmapArray(1, new Uint8Array(4));
84+
container.array[0] = value & 0xFF;
85+
container.array[1] = (value >> 8) & 0xFF;
86+
this.containers.push(container);
87+
this.keysAndCardinalities[0] = key;
88+
this.keysAndCardinalities[1] = key >> 8;
89+
pspecial += 4;
90+
for (let ispecial = 1; ispecial < lspecial; ispecial += 1) {
91+
entry += u8array[pspecial];
92+
value = entry & 0xffff;
93+
key = entry >> 16;
94+
container = this.addToArrayAt(key);
95+
const cardinalityOld = container.cardinality;
96+
container.array[cardinalityOld * 2] = value & 0xFF;
97+
container.array[(cardinalityOld * 2) + 1] = (value >> 8) & 0xFF;
98+
container.cardinality = cardinalityOld + 1;
99+
pspecial += 1;
100+
}
101+
this.consumed_len_bytes = pspecial - i;
102+
return this;
74103
} else if (u8array[i] < 0x3a) {
75104
// Special representation of tiny sets with arbitrary 32-bit integers
76105
const lspecial = u8array[i];
@@ -2330,6 +2359,7 @@ function loadDatabase(hooks) {
23302359
leaves_count = 0;
23312360
}
23322361
i += 1;
2362+
/** @type {Uint8Array} */
23332363
let data = EMPTY_UINT8;
23342364
if (!is_suffixes_only && dlen !== 0) {
23352365
data = encoded.subarray(i, i + dlen);
@@ -2343,6 +2373,7 @@ function loadDatabase(hooks) {
23432373
const branch_dlen = encoded[i] & 0x0f;
23442374
const branch_leaves_count = ((encoded[i] >> 4) & 0x0f) + 1;
23452375
i += 1;
2376+
/** @type {Uint8Array} */
23462377
let branch_data = EMPTY_UINT8;
23472378
if (!is_suffixes_only && branch_dlen !== 0) {
23482379
branch_data = encoded.subarray(i, i + branch_dlen);

src/tools/tidy/src/extdeps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ALLOWED_SOURCES: &[&str] = &[
1212
// This is `rust_team_data` used by `site` in src/tools/rustc-perf,
1313
r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#,
1414
// TMP
15-
r#""git+https://gitlab.com/notriddle/stringdex?rev=563240a4ffa22b57db94eda48a94652925a4f514#563240a4ffa22b57db94eda48a94652925a4f514""#,
15+
r#""git+https://gitlab.com/notriddle/stringdex?rev=1f8709f128425508223f95eaf14d9813803704ce#1f8709f128425508223f95eaf14d9813803704ce""#,
1616
];
1717

1818
/// Checks for external package sources. `root` is the path to the directory that contains the

0 commit comments

Comments
 (0)