Commit 87ceb0ce authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

bytes: make Write and WriteString code look the same

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5540056
parent eaecf357
......@@ -97,8 +97,7 @@ func (b *Buffer) grow(n int) int {
func (b *Buffer) Write(p []byte) (n int, err error) {
b.lastRead = opInvalid
m := b.grow(len(p))
copy(b.buf[m:], p)
return len(p), nil
return copy(b.buf[m:], p), nil
}
// WriteString appends the contents of s to the buffer. The return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment