Commit 62d11a33 authored by Rob Pike's avatar Rob Pike

use range in vector iterator

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=27003
CL=27003
parent 6d5bba51
......@@ -214,8 +214,8 @@ func (p *Vector) Swap(i, j int) {
// Iterate over all elements; driver for range
func (p *Vector) iterate(c chan Element) {
for i := 0; i < len(p.a); i++ {
c <- p.a[i]
for i, v := range p.a {
c <- v
}
close(c);
}
......
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