aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/buffer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytes/buffer.go')
-rw-r--r--src/bytes/buffer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go
index 4176d670ec..f90d9eca0f 100644
--- a/src/bytes/buffer.go
+++ b/src/bytes/buffer.go
@@ -247,8 +247,8 @@ func growSlice(b []byte, n int) []byte {
c = 2 * cap(b)
}
b2 := append([]byte(nil), make([]byte, c)...)
- copy(b2, b)
- return b2[:len(b)]
+ i := copy(b2, b)
+ return b2[:i]
}
// WriteTo writes data to w until the buffer is drained or an error occurs.