Skip to content

Commit

Permalink
Fix product of iterators without integer state (JuliaLang#28498)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamed2 authored and ararslan committed Aug 7, 2018
1 parent 5a456f3 commit 16ba04f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ iterate(::ProductIterator{Tuple{}}, state) = nothing
@inline isdone(P::ProductIterator) = any(isdone, P.iterators)
@inline function _pisdone(iters, states)
iter1 = first(iters)
done1 = isdone(iter1, first(states)) # check step
done1 = isdone(iter1, first(states)[2]) # check step
done1 === true || return done1 # false or missing
done1 = isdone(iter1) # check restart
done1 === true || return done1 # false or missing
Expand Down
3 changes: 2 additions & 1 deletion test/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ let iters = (1:2,
rand(2, 2, 2),
take(1:4, 2),
product(1:2, 1:3),
product(rand(2, 2), rand(1, 1, 1))
product(rand(2, 2), rand(1, 1, 1)),
repeated([1, -1], 2) # 28497
)
for method in [size, length, ndims, eltype]
for i = 1:length(iters)
Expand Down

0 comments on commit 16ba04f

Please sign in to comment.