Skip to content

Commit

Permalink
- Zip2 iterator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swadey committed Jun 22, 2014
1 parent b6ebf91 commit 09d1419
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions base/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ zip(a, b) = Zip2(a, b)

length(z::Zip2) = min(length(z.a), length(z.b))
start(z::Zip2) = (start(z.a), start(z.b))
next(z::Zip2, st) = ((next(z.a,st[1])[1], next(z.b,st[2])[1]),
(next(z.a,st[1])[2], next(z.b,st[2])[2]))
function next(z::Zip2, st)
n1 = next(z.a,st[1])
n2 = next(z.b,st[2])
return ((n1[1], n2[1]), (n1[2], n2[2]))
end
done(z::Zip2, st) = done(z.a,st[1]) | done(z.b,st[2])

eltype(z::Zip2) = (eltype(z.a), eltype(z.b))
Expand Down

0 comments on commit 09d1419

Please sign in to comment.