Skip to content

Commit 346199d

Browse files
maleadtKristofferC
authored andcommitted
Force specialization of the SubArray boundserror method.
Improves #29867 by avoiding an invoke. (cherry picked from commit f2d2d6f)
1 parent 8cee56d commit 346199d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/subarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ check_parent_index_match(parent, ::NTuple{N, Bool}) where {N} =
4242
# are inlined
4343
@inline Base.throw_boundserror(A::SubArray, I) =
4444
__subarray_throw_boundserror(typeof(A), A.parent, A.indices, A.offset1, A.stride1, I)
45-
@noinline __subarray_throw_boundserror(T, parent, indices, offset1, stride1, I) =
45+
@noinline __subarray_throw_boundserror(::Type{T}, parent, indices, offset1, stride1, I) where {T} =
4646
throw(BoundsError(T(parent, indices, offset1, stride1), I))
4747

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

0 commit comments

Comments
 (0)