1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:10:21 -07:00

better code for a copy loop

R=rsc
https://golang.org/cl/152046
This commit is contained in:
Robert Griesemer 2009-11-10 15:33:59 -08:00
parent 44fb865a48
commit 9e0d2fa89b

View File

@ -19,8 +19,8 @@ type Vector struct {
func copy(dst, src []Element) {
for i := 0; i < len(src); i++ {
dst[i] = src[i]
for i, x := range src {
dst[i] = x
}
}