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

Improve performance by performing an early exit #27

Merged
merged 1 commit into from
Feb 26, 2021
Merged

Improve performance by performing an early exit #27

merged 1 commit into from
Feb 26, 2021

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Feb 25, 2021

This improves performance by not performing string.replace() using the Emoji regular expression when the input is an empty string.

Also, when the input is not a string, the check should be performed before string.replace().

@sindresorhus sindresorhus merged commit a9fc011 into sindresorhus:main Feb 26, 2021
@ehmicky ehmicky deleted the early-exit branch February 26, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants