Skip to content

Commit 097f0b0

Browse files
authored
Revert "manually destruct and reconstruct subarray when throwing boundserror (#29867)" (#35748)
This reverts commit 13694f4.
1 parent 60b46a3 commit 097f0b0

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

base/subarray.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ check_parent_index_match(parent::AbstractArray{T,N}, ::NTuple{N, Bool}) where {T
4343
check_parent_index_match(parent, ::NTuple{N, Bool}) where {N} =
4444
throw(ArgumentError("number of indices ($N) must match the parent dimensionality ($(ndims(parent)))"))
4545

46-
# This makes it possible to elide view allocation in cases where the
47-
# view is indexed with a boundscheck but otherwise all its uses
48-
# are inlined
49-
@inline Base.throw_boundserror(A::SubArray, I) =
50-
__subarray_throw_boundserror(typeof(A), A.parent, A.indices, A.offset1, A.stride1, I)
51-
@noinline __subarray_throw_boundserror(::Type{T}, parent, indices, offset1, stride1, I) where {T} =
52-
throw(BoundsError(T(parent, indices, offset1, stride1), I))
53-
5446
# This computes the linear indexing compatibility for a given tuple of indices
5547
viewindexing(I::Tuple{}) = IndexLinear()
5648
# Leading scalar indices simply increase the stride

0 commit comments

Comments
 (0)