Skip to content

Commit 69c87b3

Browse files
committed
Fix another stringdex bug in that heap algo
1 parent 950e759 commit 69c87b3

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,6 @@ function loadDatabase(hooks) {
15911591
// if we want to do them in order)
15921592
for (const {node, len} of current_layer) {
15931593
const tree = await node;
1594-
if (tree.leaves_whole.isEmpty()) {
1595-
continue;
1596-
}
15971594
const length = len + tree.data.length;
15981595
if (minLength === null || length < minLength) {
15991596
minLength = length;
@@ -1618,7 +1615,9 @@ function loadDatabase(hooks) {
16181615
if (minLength !== null && backlogEntry.length > minLength) {
16191616
break;
16201617
}
1621-
yield backlogEntry.bitmap;
1618+
if (!backlogEntry.bitmap.isEmpty()) {
1619+
yield backlogEntry.bitmap;
1620+
}
16221621
backlog[0] = backlog[backlog.length - 1];
16231622
backlog.length -= 1;
16241623
let backlogSlot = 0;

tests/rustdoc-js/ordering.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const EXPECTED = [
2+
{
3+
'query': 'Entry',
4+
'others': [
5+
{ 'path': 'ordering', 'name': 'Entry1a' },
6+
{ 'path': 'ordering', 'name': 'Entry2ab' },
7+
],
8+
},
9+
];

tests/rustdoc-js/ordering.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub struct Entry1a;
2+
pub struct Entry1b;
3+
pub struct Entry2ab;

0 commit comments

Comments
 (0)