镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

perf(isISO31661Alpha3): use a Set along with .has instead of includes - #1708

Merged
profnandaa merged 1 commit into
validatorjs:masterfrom
jmpaya:feature/perf-isISO31661Alpha3
Sep 26, 2021
Merged

profnandaa merged 1 commit into
validatorjs:masterfrom
jmpaya:feature/perf-isISO31661Alpha3

Conversation

@jmpaya

@jmpaya jmpaya commented Aug 18, 2021 •

Copy link
Copy Markdown
Contributor

perf(isISO31661Alpha3): use a Set along with .has instead of includes

Updated isISO31661Alpha3 to use a Set along with .has to reduce complexity from O(n) to O(1) as stated here.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov

codecov Bot commented Aug 18, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1708 (c92c6a1) into master (8c4b3b3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1708   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          101       101           
  Lines         2005      2004    -1     
  Branches       452       452           
=========================================
- Hits          2005      2004    -1     
Impacted Files Coverage Δ
src/lib/isISO31661Alpha3.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c4b3b3...c92c6a1. Read the comment docs.

@tux-tn tux-tn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉
Thank you !

@tux-tn tux-tn added the ready-to-land For PRs that are reviewed and ready to be landed label Aug 20, 2021
@profnandaa
profnandaa merged commit 5b649c6 into validatorjs:master Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land For PRs that are reviewed and ready to be landed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants