We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rx.FindIndex(b) != nil
rx.Match(b)
I was just looking at some code that compiled a regex, and then checked for a match by writing:
rx := regexp.MustCompile(/* ... */) return rx.FindIndex(b) != nil
This is reducible to return rx.Match(b), which is less wasteful. It would be good to suggest this optimization.
return rx.Match(b)
The text was updated successfully, but these errors were encountered:
I've retitled the issue to more closely match what I think your intention is.
Sorry, something went wrong.
No branches or pull requests
I was just looking at some code that compiled a regex, and then checked for a match by writing:
This is reducible to
return rx.Match(b)
, which is less wasteful. It would be good to suggest this optimization.The text was updated successfully, but these errors were encountered: