Skip to content

Commit

Permalink
Delay bounds check until we have the full CartesianIndex complement
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Oct 13, 2020
1 parent a1da84c commit d277992
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1248,11 +1248,11 @@ function _setindex!(::IndexCartesian, A::AbstractArray{T,N}, v, I::Vararg{Int, N
end
function _setindex!(::IndexCartesian, A::AbstractArray, v, I::Vararg{Int,M}) where M
@_inline_meta
@boundscheck checkbounds(A, I...)
@inbounds r = setindex!(A, v, _to_subscript_indices(A, I...)...)
r
@boundscheck M == 0 && checkbounds(A)
return setindex!(A, v, _to_subscript_indices(A, I...)...)
end


"""
parent(A)
Expand Down

0 comments on commit d277992

Please sign in to comment.