Merge pull request #14347 from Snuffleupagus/improve-pageKidsCountCache

Improve caching in `Catalog.getPageDict` (PR 8207 follow-up)
This commit is contained in:
Tim van der Meij 2021-12-08 19:58:46 +01:00 committed by GitHub
commit b178985615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1102,7 +1102,7 @@ class Catalog {
if (isRef(currentNode)) { if (isRef(currentNode)) {
const count = pageKidsCountCache.get(currentNode); const count = pageKidsCountCache.get(currentNode);
// Skip nodes where the page can't be. // Skip nodes where the page can't be.
if (count > 0 && currentPageIndex + count < pageIndex) { if (count >= 0 && currentPageIndex + count <= pageIndex) {
currentPageIndex += count; currentPageIndex += count;
continue; continue;
} }