@@ -44,74 +44,69 @@ to_index(::BlockRange) = throw(ArgumentError("BlockRange must be converted by to
4444@inline to_indices (A, I:: Tuple{Block, Vararg{Any}} ) = to_indices (A, axes (A), I)
4545@inline to_indices (A, I:: Tuple{BlockRange, Vararg{Any}} ) = to_indices (A, axes (A), I)
4646
47- reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
47+ @propagate_inbounds reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
4848 subidxs:: Tuple{BlockSlice{<:BlockIndexRange}, Vararg{Any}} ) =
49- (@_propagate_inbounds_meta ; ( BlockSlice (BlockIndexRange (Block (idxs[1 ]. block. indices[1 ][Int (subidxs[1 ]. block. block)]),
49+ (BlockSlice (BlockIndexRange (Block (idxs[1 ]. block. indices[1 ][Int (subidxs[1 ]. block. block)]),
5050 subidxs[1 ]. block. indices),
5151 idxs[1 ]. indices[subidxs[1 ]. indices]),
52- reindex (tail (idxs), tail (subidxs))... ))
53- reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
52+ reindex (tail (idxs), tail (subidxs))... )
53+ @propagate_inbounds reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
5454 subidxs:: Tuple{BlockSlice{<:Block}, Vararg{Any}} ) =
55- (@_propagate_inbounds_meta ; ( BlockSlice (idxs[1 ]. block[Int (subidxs[1 ]. block)],
55+ (BlockSlice (idxs[1 ]. block[Int (subidxs[1 ]. block)],
5656 idxs[1 ]. indices[subidxs[1 ]. indices]),
57- reindex (tail (idxs), tail (subidxs))... ))
57+ reindex (tail (idxs), tail (subidxs))... )
5858
59- reindex (idxs:: Tuple{BlockedUnitRange, Vararg{Any}} ,
59+ @propagate_inbounds reindex (idxs:: Tuple{BlockedUnitRange, Vararg{Any}} ,
6060 subidxs:: Tuple{BlockSlice{<:Block}, Vararg{Any}} ) =
61- (@_propagate_inbounds_meta ; ( BlockSlice (subidxs[1 ]. block,
61+ (BlockSlice (subidxs[1 ]. block,
6262 idxs[1 ][subidxs[1 ]. block]),
63- reindex (tail (idxs), tail (subidxs))... ))
63+ reindex (tail (idxs), tail (subidxs))... )
6464# _splatmap taken from Base:
6565_splatmap (f, :: Tuple{} ) = ()
6666_splatmap (f, t:: Tuple ) = (f (t[1 ])... , _splatmap (f, tail (t))... )
6767
6868# De-reference blocks before creating a view to avoid taking `global2blockindex`
6969# path in `AbstractBlockStyle` broadcasting.
70- @inline function Base. unsafe_view (
70+ @propagate_inbounds function Base. unsafe_view (
7171 A:: BlockArray{<:Any, N} ,
7272 I:: Vararg{BlockSlice{<:BlockIndexRange{1}}, N} ) where {N}
73- @_propagate_inbounds_meta
7473 B = view (A, map (block, I)... )
7574 return view (B, _splatmap (x -> x. block. indices, I)... )
7675end
7776
78- @inline function Base. unsafe_view (
77+ @propagate_inbounds function Base. unsafe_view (
7978 A:: PseudoBlockArray{<:Any, N} ,
8079 I:: Vararg{BlockSlice{<:BlockIndexRange{1}}, N} ) where {N}
81- @_propagate_inbounds_meta
8280 return view (A. blocks, map (x -> x. indices, I)... )
8381end
8482
85- @inline function Base. unsafe_view (
83+ @propagate_inbounds function Base. unsafe_view (
8684 A:: ReshapedArray{<:Any, N, <:AbstractBlockArray{<:Any, M}} ,
8785 I:: Vararg{BlockSlice{<:BlockIndexRange{1}}, N} ) where {N, M}
88- @_propagate_inbounds_meta
8986 # Note: assuming that I[M+1:end] are verified to be singletons
9087 return reshape (view (A. parent, I[1 : M]. .. ), Val (N))
9188end
9289
93- @inline function Base. unsafe_view (
90+ @propagate_inbounds function Base. unsafe_view (
9491 A:: Array{<:Any, N} ,
9592 I:: Vararg{BlockSlice{<:BlockIndexRange{1}}, N} ) where {N}
96- @_propagate_inbounds_meta
9793 return view (A, map (x -> x. indices, I)... )
9894end
9995
10096# make sure we reindex correctrly
101- function Base. _maybe_reindex (V, I:: Tuple{BlockSlice{<:BlockIndexRange{1}}, Vararg{Any}} , :: Tuple{} )
102- @_inline_meta
97+ @inline function Base. _maybe_reindex (V, I:: Tuple{BlockSlice{<:BlockIndexRange{1}}, Vararg{Any}} , :: Tuple{} )
10398 @inbounds idxs = to_indices (V. parent, reindex (V. indices, I))
10499 view (V. parent, idxs... )
105100end
106101
107102
108103# BlockSlices map the blocks and the indices
109104# this is loosely based on Slice reindex in subarray.jl
110- reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
105+ @propagate_inbounds reindex (idxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ,
111106 subidxs:: Tuple{BlockSlice{<:BlockRange}, Vararg{Any}} ) =
112- (@_propagate_inbounds_meta ; ( BlockSlice (BlockRange (idxs[1 ]. block. indices[1 ][Int .(subidxs[1 ]. block)]),
107+ (BlockSlice (BlockRange (idxs[1 ]. block. indices[1 ][Int .(subidxs[1 ]. block)]),
113108 idxs[1 ]. indices[subidxs[1 ]. block]),
114- reindex (tail (idxs), tail (subidxs))... ))
109+ reindex (tail (idxs), tail (subidxs))... )
115110
116111
117112function reindex (idxs:: Tuple{BlockSlice{Block{1,Int}}, Vararg{Any}} ,
0 commit comments