Skip to content

Commit

Permalink
Force specialization of the SubArray boundserror method. (#30666)
Browse files Browse the repository at this point in the history
Improves #29867 by avoiding an invoke.
  • Loading branch information
maleadt authored and KristofferC committed Jan 10, 2019
1 parent 0df9b83 commit bb636aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/subarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ check_parent_index_match(parent, ::NTuple{N, Bool}) where {N} =
# are inlined
@inline Base.throw_boundserror(A::SubArray, I) =
__subarray_throw_boundserror(typeof(A), A.parent, A.indices, A.offset1, A.stride1, I)
@noinline __subarray_throw_boundserror(T, parent, indices, offset1, stride1, I) =
@noinline __subarray_throw_boundserror(::Type{T}, parent, indices, offset1, stride1, I) where {T} =
throw(BoundsError(T(parent, indices, offset1, stride1), I))

# This computes the linear indexing compatibility for a given tuple of indices
Expand Down

0 comments on commit bb636aa

Please sign in to comment.