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
A new performance check: prefer operator comparisons to strings.Compare #1167
Comments
@go101 contribution guide: https://github.com/quasilyte/go-perfguard/blob/master/_docs/CONTRIBUTING.md |
I would add them to go-critic though. I think that |
By the way. @go101 thank you for your books. ❤️ |
@quasilyte can be closed as i see |
I think that we haven't implemented all of the suggested patterns. |
The current implementation of the
strings.Compare
function is not efficient, in a some deliberate way.refs:
strings.Compare
to compare strings golang/go#50209At least, for non-three-way comparisons, using operators to compare strings is always faster than using the
strings.Compare
function.The text was updated successfully, but these errors were encountered: