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
why doesnt use bytes.Equal() ? so we dont need additional string() comparison
if string(k) == string(chunk[idx:idx+keyLen]) {
The text was updated successfully, but these errors were encountered:
Because bytes.Equal is implemented in the same way - see https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/bytes/bytes.go;l=18 :
bytes.Equal
func Equal(a, b []byte) bool { return string(a) == string(b) }
Go compiler automatically optimizes such a comparison in the most efficient way.
Sorry, something went wrong.
No branches or pull requests
why doesnt use bytes.Equal() ? so we dont need additional string() comparison
if string(k) == string(chunk[idx:idx+keyLen]) {
The text was updated successfully, but these errors were encountered: