perf(isISO31661Alpha3): use a Set along with .has instead of includes by jmpaya · Pull Request #1708 · validatorjs/validator.js

Conversation

@jmpaya

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

fedeci

tux-tn

Choose a reason for hiding this comment

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

LGTM 🎉
Thank you !

profnandaa

Labels