-
Notifications
You must be signed in to change notification settings - Fork 10.3k
A couple of improvements of getDestination
(unit-test included)
#6187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A couple of improvements of getDestination
(unit-test included)
#6187
Conversation
Doing this helped uncover an issue with the `getDestination` implementation. Currently if a named destination doesn't exist, the method (in `obj.js`) may return `undefined` which leads to the promise being stuck in a pending state. *Note:* returning `null` for this case is consistent with other methods, e.g. `getOutline` and `getAttachments`.
For named destinations that are contained in a `Dict`, as opposed to a `NameTree`, we currently iterate through the *entire* dictionary just to fetch *one* destination. This code appears to simply have been copy-pasted from the `get destinations` method, but in its current form it's quite unnecessary/inefficient since can just get the required destination directly instead.
Do you happen to have one or more PDF files that can be used for testing this? It looks good, but especially the second commit would be good to test with a file that has named destinations in a Dict. |
Apart from |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/50f811d2fbc5891/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/50f811d2fbc5891/output.txt Total script time: 0.71 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ad8d9ce2fc46d3f/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/7c2e2892057003c/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ad8d9ce2fc46d3f/output.txt Total script time: 18.27 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/7c2e2892057003c/output.txt Total script time: 19.23 mins
|
…tion A couple of improvements of `getDestination` (unit-test included)
Nice work, thank you! |
Please refer to the individual commit messages.