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
Checking the Write and WriteString made me realize that we try to grow by reslicing first, but if it is not possible we call grow. But the grow function tries again to grow by reslice, making a second call to reslice. I think in this case it is not needed to call:
m, ok := b.tryGrowByReslice(len(p))
Is enough to call directly grow function.
What did you expect to see?
Call only grow function.
What did you see instead?
Double call to tryGrowByReslice.
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
Double call to tryGoByReslice in bytes.Buffer when writing.
bytes: double call to tryGoByReslice in bytes.Buffer when writing
Mar 27, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.10
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
Checking the Write and WriteString made me realize that we try to grow by reslicing first, but if it is not possible we call grow. But the grow function tries again to grow by reslice, making a second call to reslice. I think in this case it is not needed to call:
Is enough to call directly grow function.
What did you expect to see?
Call only grow function.
What did you see instead?
Double call to tryGrowByReslice.
The text was updated successfully, but these errors were encountered: