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
The text was updated successfully, but these errors were encountered:
mariecurried
changed the title
cmd/compile: don't call growslice if the slice has capacity
cmd/compile: don't generate call to growslice if the slice has capacity
Aug 26, 2019
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
I compiled these three versions of the same function: https://godbolt.org/z/8UTTBt.
Here is one of them:
What did you expect to see?
I didn't expect that these functions would't have code to call
growslice
.What did you see instead?
Instead, said code was generated, as if the slices don't have capacity for the new elements.
I found this while compiling the following function (https://godbolt.org/z/FFCJGe), but figured it also happened for the simpler cases above:
The text was updated successfully, but these errors were encountered: