You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in[i:] is the same as in[i:len(in):cap(in)], not in[i:len(in):len(in)]. If I change b to actually be semantically equivalent to a, then they compile to the same number of instructions for me on linux/amd64.
Your bug report as originally stated is invalid: you're comparing two functions with different semantics, so it's unsurprising that the Go compiler compiles them into different instruction sequences.
If you can suggest a more efficient instruction sequence that the Go compiler could use to implement awithout altering its semantics, that would be something we could consider.
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +bc94282 2016-04-04 21:22:44 +0000 linux/amd64
go env
)?Same assembly for both.
a is larger.
The text was updated successfully, but these errors were encountered: