@@ -85,7 +85,7 @@ the ordering of the dimensions will match those in `dims`. If `drop = false`, th
85
85
`Slices` will have the same dimensionality as the underlying array, with inner
86
86
dimensions having size 1.
87
87
88
- See [`stack`](@ref)`(slices; dims)` for the inverse of `eachcol (A; dims::Integer, drop=true )`.
88
+ See [`stack`](@ref)`(slices; dims)` for the inverse of `eachslice (A; dims::Integer)`.
89
89
90
90
See also [`eachrow`](@ref), [`eachcol`](@ref), [`mapslices`](@ref) and [`selectdim`](@ref).
91
91
@@ -232,9 +232,13 @@ size(s::Slices) = map(length, s.axes)
232
232
return map (l -> l === (:) ? (:) : c[l], s. slicemap)
233
233
end
234
234
235
- Base. @propagate_inbounds getindex (s:: Slices{P,SM,AX,S,N} , I:: Vararg{Int,N} ) where {P,SM,AX,S,N} =
236
- view (s. parent, _slice_index (s, I... )... )
237
- Base. @propagate_inbounds setindex! (s:: Slices{P,SM,AX,S,N} , val, I:: Vararg{Int,N} ) where {P,SM,AX,S,N} =
238
- s. parent[_slice_index (s, I... )... ] = val
235
+ @inline function getindex (s:: Slices{P,SM,AX,S,N} , I:: Vararg{Int,N} ) where {P,SM,AX,S,N}
236
+ @boundscheck checkbounds (s, I... )
237
+ @inbounds view (s. parent, _slice_index (s, I... )... )
238
+ end
239
+ @inline function setindex! (s:: Slices{P,SM,AX,S,N} , val, I:: Vararg{Int,N} ) where {P,SM,AX,S,N}
240
+ @boundscheck checkbounds (s, I... )
241
+ @inbounds s. parent[_slice_index (s, I... )... ] = val
242
+ end
239
243
240
244
parent (s:: Slices ) = s. parent
0 commit comments