Skip to content

Commit aa72f72

Browse files
chethegaKristofferC
authored andcommitted
help type inference for logical indexing (#29633)
1 parent cd0bd33 commit aa72f72

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

base/multidimensional.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,10 @@ end
517517
# We're looking for the n-th true element, using iterator r at state i
518518
n = s[1]
519519
n > length(L) && return nothing
520+
#unroll once to help inference, cf issue #29418
521+
idx, i = iterate(tail(s)...)
522+
s = (n+1, s[2], i)
523+
L.mask[idx] && return (idx, s)
520524
while true
521525
idx, i = iterate(tail(s)...)
522526
s = (n+1, s[2], i)

0 commit comments

Comments
 (0)