Skip to content

Commit 35c67e5

Browse files
haampieKristofferC
authored andcommitted
Make sure iterate(::Tuple) does not throw (#28847)
1 parent eb8a933 commit 35c67e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/tuple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _setindex(v, i::Integer) = ()
3838

3939
## iterating ##
4040

41-
iterate(t::Tuple, i::Int=1) = length(t) < i ? nothing : (t[i], i+1)
41+
iterate(@nospecialize(t::Tuple), i::Int=1) = 1 <= i <= length(t) ? (@inbounds t[i], i+1) : nothing
4242

4343
keys(@nospecialize t::Tuple) = OneTo(length(t))
4444

0 commit comments

Comments
 (0)