mirror of
https://github.com/golang/go
synced 2024-11-21 23:24:41 -07:00
bytes: make Write and WriteString code look the same
R=golang-dev, r CC=golang-dev https://golang.org/cl/5540056
This commit is contained in:
parent
eaecf357e7
commit
87ceb0cec7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user