1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Avoid unnecessary parsing, in Page.GetStructTree, when no structTree is available (PR 13221 follow-up)

It's obviously (a bit) more efficient to return early in `Page.getStructTree`, rather than trying to first "parse" an *empty* structTree-root.

*Somehow I didn't think of this yesterday, but this feels like a much better solution overall; sorry about the churn here!*
This commit is contained in:
Jonas Jenwald 2021-04-12 08:52:35 +02:00
parent 0d2dd6c2fe
commit 9360c7cbdc
3 changed files with 10 additions and 14 deletions

View file

@ -328,10 +328,6 @@ class StructTreePage {
}
nodeToSerializable(child, root);
}
if (root.children.length === 0) {
return null;
}
return root;
}
}