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

Slightly re-factor setting of the link target in addLinkAttributes #11302

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

I happened to look at this code and the way that the link target is set seems unecessarily convoluted, since we're using Object.values and Array.prototype.includes for every link being parsed.
Given that the number of link targets are so few, the easist solution honestly seem to be to just use a switch statement to do the link target mapping.

I happened to look at this code and the way that the link target is set seems unecessarily convoluted, since we're using `Object.values` and `Array.prototype.includes` for *every* link being parsed.
Given that the number of link targets are so few, the easist solution honestly seem to be to just use a `switch` statement to do the link target mapping.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Nov 2, 2019

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/cbee358bf2c05af/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 2, 2019

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/75f534f683834e6/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Nov 2, 2019

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/cbee358bf2c05af/output.txt

Total script time: 2.63 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

pdfjsbot commented Nov 2, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/75f534f683834e6/output.txt

Total script time: 5.32 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit e7f24bd into mozilla:master Nov 2, 2019
@timvandermeij
Copy link
Contributor

I definitely agree with this; I also had to re-read the code to see how it worked. Thank you for simplifying this!

@Snuffleupagus Snuffleupagus deleted the addLinkAttributes-switch-target branch November 2, 2019 22:47
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