perf(isISO31661Alpha3): use a Set along with .has instead of includes by jmpaya · Pull Request #1708 · validatorjs/validator.js
Conversation
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)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Thank you !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters