Closed jayrhynas closed 9 years ago
You can return a little earlier when there is no match by replacing the second breaker with:
if (qlen === tlen) { return query === text; }
Since if the lengths are equal but the query does not equal the text, there is no way the query will match the text.
Nice one. Care to create a pull request?
You can return a little earlier when there is no match by replacing the second breaker with:
Since if the lengths are equal but the query does not equal the text, there is no way the query will match the text.