Skip to content
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

Add a new size getter and getRawValues method, to Dict instances, to simplify some code #12101

Merged
merged 3 commits into from
Jul 17, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

Please refer to the individual commit messages for additional details.

… checking the number of entries

This removes the need to manually call `Dict.getKeys()` and check its length.
…r way of getting all *raw* values

When the old `Dict.getAll()` method was removed, it was replaced with a `Dict.getKeys()` call and `Dict.get(...)` calls (in a loop).
While this pattern obviously makes a lot of sense in many cases, there's some instances where we actually want the *raw* `Dict` values (i.e. `Ref`s where applicable). In those cases, `Dict.getRaw(...)` calls are instead used within the loop. However, by introducing a new `Dict.getRawValues()` method we can reduce the number of (strictly unnecessary) function calls by simply getting the *raw* `Dict` values directly.
…used by the `ObjectLoader`)

Besides being fewer lines of code overall, this also avoids *one* `node instanceof Dict` check for both of the `Dict`/`Stream`-cases.
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/793f3744963fc62/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/99a2d9de7ca81e6/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/793f3744963fc62/output.txt

Total script time: 26.70 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/793f3744963fc62/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/99a2d9de7ca81e6/output.txt

Total script time: 28.55 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/99a2d9de7ca81e6/reftest-analyzer.html#web=eq.log

@timvandermeij timvandermeij changed the title Add a new size getter and getRawValues method, to Dict` instances, to simplify some code Add a new size getter and getRawValues method, to Dict instances, to simplify some code Jul 17, 2020
@timvandermeij timvandermeij merged commit 90689cf into mozilla:master Jul 17, 2020
@timvandermeij
Copy link
Contributor

Nice improvements!

@Snuffleupagus Snuffleupagus deleted the Dict-size-getRawValues branch July 17, 2020 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants