Commit 24bfd652 authored by Kyle Consalus's avatar Kyle Consalus Committed by Robert Griesemer

Conversion from loop to copy().

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1072041
parent 5789c86f
......@@ -275,9 +275,7 @@ func Map(mapping func(rune int) int, s string) string {
// 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])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment