Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change.
LGTM. Thanks. - gri On Mon, May 3, 2010 at 12:43 PM, <consalus@gmail.com> wrote: > Reviewers: golang-dev_googlegroups.com, > > Message: > Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > Conversion from loop to copy(). > > Please review this at http://codereview.appspot.com/1072041/show > > Affected files: > M src/pkg/strings/strings.go > > > Index: src/pkg/strings/strings.go > =================================================================== > --- a/src/pkg/strings/strings.go > +++ b/src/pkg/strings/strings.go > @@ -275,9 +275,7 @@ > // Grow the buffer. > maxbytes = maxbytes*2 + utf8.UTFMax > nb := make([]byte, maxbytes) > - for i, c := range b[0:nbytes] { > - nb[i] = c > - } > + copy(nb, b[0:nbytes]) > b = nb > } > nbytes += utf8.EncodeRune(rune, b[nbytes:maxbytes]) > > >
*** Submitted as http://code.google.com/p/go/source/detail?r=284bfbf730ee *** Conversion from loop to copy(). R=golang-dev, gri CC=golang-dev http://codereview.appspot.com/1072041 Committer: Robert Griesemer <gri@golang.org>