@@ -85,7 +85,7 @@ the ordering of the dimensions will match those in `dims`. If `drop = false`, th
8585`Slices` will have the same dimensionality as the underlying array, with inner
8686dimensions having size 1.
8787
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)`.
8989
9090See also [`eachrow`](@ref), [`eachcol`](@ref), [`mapslices`](@ref) and [`selectdim`](@ref).
9191
@@ -232,9 +232,13 @@ size(s::Slices) = map(length, s.axes)
232232 return map (l -> l === (:) ? (:) : c[l], s. slicemap)
233233end
234234
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
239243
240244parent (s:: Slices ) = s. parent
0 commit comments