]> Cypherpunks repositories - gostls13.git/commitdiff
strings: minor cleanup
authorRui Ueyama <ruiu@google.com>
Mon, 24 Mar 2014 01:58:35 +0000 (18:58 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 24 Mar 2014 01:58:35 +0000 (18:58 -0700)
bi is a slice and not an array, so bi[:] does not make much sense.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/79280043

src/pkg/strings/replace.go

index 54c9323e0489137a5b19f8f5ab2974c8d2d89014..3e05d2057bef48181cc80dcdbc76e0f6b7862ad0 100644 (file)
@@ -492,7 +492,7 @@ func (r *byteStringReplacer) Replace(s string) string {
        for i := 0; i < len(s); i++ {
                b := s[i]
                if r.old[b>>5]&uint32(1<<(b&31)) != 0 {
-                       n := copy(bi[:], r.new[b])
+                       n := copy(bi, r.new[b])
                        bi = bi[n:]
                } else {
                        bi[0] = b