Fix inconsistencies with the Page.prototype.#replaceIdByRef method - #21812
Fix inconsistencies with the Page.prototype.#replaceIdByRef method#21812Snuffleupagus wants to merge 1 commit into
Page.prototype.#replaceIdByRef method#21812Conversation
This private method has two call-sites, which provide *different* `deletedAnnotations` parameters; see - https://github.com/mozilla/pdf.js/blob/0f26334f9d6f96119f6e5164fb65832fbbde7344/src/core/document.js#L378-L384 - https://github.com/mozilla/pdf.js/blob/0f26334f9d6f96119f6e5164fb65832fbbde7344/src/core/document.js#L534-L539 Thanks to the similarities between the `RefMap` and `RefSet` classes this inconsistency hasn't caused any bugs, as far as I know, but it should still be fixed. Given how the `deletedAnnotations` is being used, a `RefSet` really seems to be the "correct" data-structure to use here since we only need to track references. Finally, make use of an early `continue` to reduce overall indentation and thus shorten the code in the `Page.prototype.#replaceIdByRef` method.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21812 +/- ##
==========================================
- Coverage 90.20% 90.20% -0.01%
==========================================
Files 264 264
Lines 67339 67340 +1
==========================================
Hits 60741 60741
- Misses 6598 6599 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/b70df2f47d95dbb/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e1d432b8fb63896/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/e1d432b8fb63896/output.txt Total script time: 18.22 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/b70df2f47d95dbb/output.txt Total script time: 23.46 mins
|
This private method has two call-sites, which provide different
deletedAnnotationsparameters; seepdf.js/src/core/document.js
Lines 378 to 384 in 0f26334
pdf.js/src/core/document.js
Lines 534 to 539 in 0f26334
Thanks to the similarities between the
RefMapandRefSetclasses this inconsistency hasn't caused any bugs, as far as I know, but it should still be fixed.Given how the
deletedAnnotationsis being used, aRefSetreally seems to be the "correct" data-structure to use here since we only need to track references.Finally, make use of an early
continueto reduce overall indentation and thus shorten the code in thePage.prototype.#replaceIdByRefmethod.Much smaller diff with https://github.com/mozilla/pdf.js/pull/21812/changes?w=1