remove bytes.Copy

replace all calls with calls to copy
use copy in regexp and bytes.Buffer

R=rsc
CC=golang-dev
https://golang.org/cl/157073
This commit is contained in:
Rob Pike 2009-11-18 15:24:24 -08:00
parent 093493c6a5
commit e70cedfaec
22 changed files with 147 additions and 218 deletions

View file

@ -20,10 +20,11 @@ func copyString(dst []byte, doff int, str string) {
// Copy from bytes to byte array at offset doff. Assume there's room.
func copyBytes(dst []byte, doff int, src []byte) {
for soff := 0; soff < len(src); soff++ {
dst[doff] = src[soff];
doff++;
if len(src) == 1 {
dst[doff] = src[0];
return;
}
copy(dst[doff:len(dst)], src);
}
// A Buffer is a variable-sized buffer of bytes