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

perf(encode/decodeURL): use legacy url.parse() to avoid try...catch() #128

Merged
merged 3 commits into from Nov 17, 2019

Conversation

@curbengh
Copy link
Contributor

curbengh commented Nov 10, 2019

Part of hexojs/hexo#3846

TL;DR

  try {
    return new URL(str);
  } catch (err) {
    return str;
  }

is expensive.

curbengh added 3 commits Nov 10, 2019
@curbengh curbengh requested a review from hexojs/core Nov 10, 2019
@curbengh curbengh added this to In progress in Drop legacy URL API via automation Nov 10, 2019
@curbengh curbengh moved this from In progress to To do in Drop legacy URL API Nov 10, 2019
@coveralls

This comment has been minimized.

Copy link

coveralls commented Nov 10, 2019

Coverage Status

Coverage decreased (-0.06%) to 95.395% when pulling edb74ff on curbengh:parse-encode-url into 71bbcc4 on hexojs:master.

@SukkaW
SukkaW approved these changes Nov 10, 2019
@curbengh curbengh merged commit fbdf4e0 into hexojs:master Nov 17, 2019
2 of 3 checks passed
2 of 3 checks passed
coverage/coveralls Coverage decreased (-0.06%) to 95.395%
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Drop legacy URL API automation moved this from To do to Done Nov 17, 2019
@curbengh curbengh deleted the curbengh:parse-encode-url branch Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.