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

Part of hexojs/hexo#3846

TL;DR

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

is expensive.

@curbengh curbengh requested a review from a team November 10, 2019 06:16
@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
Copy link

Coverage Status

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

@curbengh curbengh merged commit fbdf4e0 into hexojs:master Nov 17, 2019
Drop legacy URL API automation moved this from To do to Done Nov 17, 2019
@curbengh curbengh deleted the parse-encode-url branch November 17, 2019 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants