Skip to content

Commit

Permalink
help type inference for logical indexing (#29633)
Browse files Browse the repository at this point in the history
(cherry picked from commit aa72f72)
  • Loading branch information
chethega authored and KristofferC committed Feb 20, 2020
1 parent 6d3120c commit 430df6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ end
# We're looking for the n-th true element, using iterator r at state i
n = s[1]
n > length(L) && return nothing
#unroll once to help inference, cf issue #29418
idx, i = iterate(tail(s)...)
s = (n+1, s[2], i)
L.mask[idx] && return (idx, s)
while true
idx, i = iterate(tail(s)...)
s = (n+1, s[2], i)
Expand Down

0 comments on commit 430df6e

Please sign in to comment.