aboutsummaryrefslogtreecommitdiff
path: root/src/bytes/buffer.go
diff options
context:
space:
mode:
authorGabriel Aszalos <gabriel.aszalos@gmail.com>2017-09-18 17:07:21 +0200
committerJoe Tsai <thebrokentoaster@gmail.com>2017-09-18 16:48:34 +0000
commit66ce8e383f1070320b9d63d06dc7f5ec40d35135 (patch)
tree99417c763a8547b5a900d79409313301827b650f /src/bytes/buffer.go
parent57c79febda993fe2f4b43db07476219e7b07b452 (diff)
downloadgo-66ce8e383f1070320b9d63d06dc7f5ec40d35135.tar.xz
bytes: removed unnecessary slicing on copy
Change-Id: Ia42e3479c852a88968947411de8b32e5bcda5ae3 Reviewed-on: https://go-review.googlesource.com/64371 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/bytes/buffer.go')
-rw-r--r--src/bytes/buffer.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go
index 67566a13d9..099e431a36 100644
--- a/src/bytes/buffer.go
+++ b/src/bytes/buffer.go
@@ -131,7 +131,7 @@ func (b *Buffer) grow(n int) int {
// slice. We only need m+n <= c to slide, but
// we instead let capacity get twice as large so we
// don't spend all our time copying.
- copy(b.buf[:], b.buf[b.off:])
+ copy(b.buf, b.buf[b.off:])
} else if c > maxInt-c-n {
panic(ErrTooLarge)
} else {