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

Factor out repeated Ref key string generation code. #4973

Merged
merged 1 commit into from
Jun 20, 2014

Conversation

nnethercote
Copy link
Contributor

There are three different ways that we convert a Ref to a string to index into
a table:

  • src/core/obj.js: 'R1.0'
  • web/viewer.js: '1 0 R'
  • src/core/evaluator.js: '1_0'

These are scattered throughout the code.

This patch factors out the first and second cases into a new function,
Ref.prototype.toString(). The 'R1.0' form from obj.js is used for both.

The patch doesn't change evaluator.js because I couldn't determine if the '1_0'
form has special significance.

@Snuffleupagus
Copy link
Collaborator

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/0c9ae8e86996d51/output.txt

@Snuffleupagus
Copy link
Collaborator

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/c76fc6327676a83/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/e957d6e1b42e818/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/c76fc6327676a83/output.txt

Total script time: 2.84 mins

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

Image differences available at: http://107.22.172.223:8877/c76fc6327676a83/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/e957d6e1b42e818/output.txt

Total script time: 23.76 mins

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

@yurydelendik
Copy link
Contributor

Object that is used in the core/ is different that is used in the web/viewer.js (it passed though the worker). I'll be okay accepting only core/obj.js refactoring.

In src/core/obj.js, we convert a Ref to a string to index into a table like
this: 'R1.0'.  This conversion is repeated numerous times.

This patch factors out the conversion into a new function.
Ref.prototype.toString().
@nnethercote
Copy link
Contributor Author

Good catch. I updated the patch to remove the viewer.js change. I'm surprised the previous patch passed the tests.

@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/91440cd11b502cd/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/53035afdb40762b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/53035afdb40762b/output.txt

Total script time: 3.06 mins

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

Image differences available at: http://107.22.172.223:8877/53035afdb40762b/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/91440cd11b502cd/output.txt

Total script time: 23.80 mins

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

yurydelendik added a commit that referenced this pull request Jun 20, 2014
Factor out repeated Ref key string generation code.
@yurydelendik yurydelendik merged commit 84157e0 into mozilla:master Jun 20, 2014
@yurydelendik
Copy link
Contributor

Thank you

@nnethercote nnethercote deleted the better-ref-keys branch August 6, 2014 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants