Skip to content

Commit

Permalink
Force specialization of the SubArray boundserror method.
Browse files Browse the repository at this point in the history
Improves #29867 by avoiding an invoke.

(cherry picked from commit f2d2d6f)
  • Loading branch information
maleadt authored and KristofferC committed Jan 11, 2019
1 parent cec7e7b commit 17f2978
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 17f2978

Please sign in to comment.