-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Convert PDFPageViewBuffer
to a standard class, and use a Set
internally
#14245
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
Convert PDFPageViewBuffer
to a standard class, and use a Set
internally
#14245
Conversation
…it-test (PR 14238 follow-up) This small change will help validate an important part of the upcoming re-factoring, regarding the *correct* iteration of the `Set` in the `PDFPageViewBuffer.resize` method in particular.
This patch makes use of private `class` fields, to ensure that the previously "private" properties remain as such.
This relies on the fact that `Set`s preserve the insertion order[1], which means that we can utilize an iterator to access the *first* stored view. Note that in the `resize`-method, we can now move the visible pages to the back of the buffer using a single loop (hence we don't need to use the `moveToEndOfArray` helper function any more). --- [1] This applies to `Map`s as well, although that's not entirely relevant here.
With the previous patch, this helper function is no longer used and keeping it around will simply increase the size of the builds. This removal is purposely done *separately*, to make it easy to revert the patch in the future if this helper function would become useful again.
if (++i > ii) { | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note: The unit-test was updated to ensure that I didn't mess up this particular condition.
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f782d4299391a8a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/9cfa9240d8ae041/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f782d4299391a8a/output.txt Total script time: 2.97 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/9cfa9240d8ae041/output.txt Total script time: 6.12 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/455eaee7a43e1ed/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/455eaee7a43e1ed/output.txt Total script time: 4.37 mins Published |
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/aa865176a9e79e9/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e0cba4b48d8dda0/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/e0cba4b48d8dda0/output.txt Total script time: 3.94 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/aa865176a9e79e9/output.txt Total script time: 6.15 mins
|
This looks great; thank you for doing this! |
Please refer to the individual commit messages.