Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using .Base:
(:), |, +, -, *, !==, !, ==, !=, <=, <, >, >=, =>, missing,
any, _counttuple, eachindex, ntuple, zero, prod, reduce, in, firstindex, lastindex,
tail, fieldtypes, min, max, minimum, zero, oneunit, promote, promote_shape, LazyString,
afoldl, mod1
afoldl, mod1, @default_eltype
using .Core
using Core: @doc

Expand Down Expand Up @@ -1176,6 +1176,8 @@ end
next === nothing && return nothing
restnext = _piterate(rest...)
restnext === nothing && return nothing
VS = @default_eltype(iter1)
next = Pair{VS, typeof(next[2])}(next[1], next[2])
return (next, restnext...)
end
@inline function iterate(P::ProductIterator)
Expand All @@ -1188,15 +1190,16 @@ end
@inline _piterate1(::Tuple{}, ::Tuple{}) = nothing
@inline function _piterate1(iters, states)
iter1 = first(iters)
next = iterate(iter1, first(states)[2])
restnext = tail(states)
state1, restnext... = states
next = iterate(iter1, state1[2])
if next === nothing
isdone(iter1) === true && return nothing
restnext = _piterate1(tail(iters), restnext)
restnext === nothing && return nothing
next = iterate(iter1)
next === nothing && return nothing
end
next = Pair{fieldtype(typeof(state1), 1), typeof(next[2])}(next[1], next[2])
return (next, restnext...)
end
@inline function iterate(P::ProductIterator, states)
Expand Down