Index: src/pkg/exp/eval/func.go |
=================================================================== |
--- a/src/pkg/exp/eval/func.go |
+++ b/src/pkg/exp/eval/func.go |
@@ -46,9 +46,7 @@ |
n := len(b.instrs) |
if n >= cap(b.instrs) { |
a := make(code, n, n*2) |
- for i := range b.instrs { |
- a[i] = b.instrs[i] |
- } |
+ copy(a, b.instrs) |
b.instrs = a |
} |
b.instrs = b.instrs[0 : n+1] |
@@ -60,9 +58,7 @@ |
func (b *codeBuf) get() code { |
// Freeze this buffer into an array of exactly the right size |
a := make(code, len(b.instrs)) |
- for i := range b.instrs { |
- a[i] = b.instrs[i] |
- } |
+ copy(a, b.instrs) |
return code(a) |
} |