aboutsummaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
authorIvan Sharavuev <shpiwan@gmail.com>2018-10-13 13:14:39 +0300
committerIskander Sharipov <iskander.sharipov@intel.com>2018-10-13 11:17:13 +0000
commitc4f07510a0161c4493a751984e24532a1b189759 (patch)
treeb2fe53c495157b68c85e1f867fb9febf948a345d /src/strings
parentb4150f76144808bf0015fe23be0e2ade32a14599 (diff)
downloadgo-c4f07510a0161c4493a751984e24532a1b189759.tar.gz
go-c4f07510a0161c4493a751984e24532a1b189759.zip
strings: Replace s[:] to s where s is a slice.
Change-Id: Ie7ba3f9ece9b0fc0e8a5c92fbae9c3b558815e4c Reviewed-on: https://go-review.googlesource.com/c/141997 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Iskander Sharipov <iskander.sharipov@intel.com>
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/replace.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/strings/replace.go b/src/strings/replace.go
index 9ddf5e1e3f..ace0b8d646 100644
--- a/src/strings/replace.go
+++ b/src/strings/replace.go
@@ -459,7 +459,7 @@ func (r *byteReplacer) WriteString(w io.Writer, s string) (n int, err error) {
buf := make([]byte, bufsize)
for len(s) > 0 {
- ncopy := copy(buf, s[:])
+ ncopy := copy(buf, s)
s = s[ncopy:]
for i, b := range buf[:ncopy] {
buf[i] = r[b]