216216end
217217@propagate_inbounds function _to_indices (:: StaticInt{N} , A, axs:: Tuple , args:: Tuple ) where {N}
218218 axes_front, axes_tail = Base. IteratorsMD. split (axs, Val (N))
219- return _to_multi_indices (A , axes_front, axes_tail, first (args), _maybe_tail (args))
219+ return ( to_index ( _layout ( IndexStyle (A) , axes_front), first (args)), to_indices (A, axes_tail, _maybe_tail (args)) ... )
220220end
221- @propagate_inbounds function _to_multi_indices (
222- A,
223- axes_front:: Tuple ,
224- axes_tail:: Tuple ,
225- arg:: Union{LinearIndices,CartesianIndices} ,
226- args:: Tuple
227- )
228- return (to_indices (A, axes_front, axes (arg))... , to_indices (A, axes_tail, args)... ,)
229- end
230- @propagate_inbounds function _to_multi_indices (
231- A,
232- axes_front:: Tuple ,
233- axes_tail:: Tuple ,
234- arg:: AbstractCartesianIndex ,
235- args:: Tuple
236- )
237- return (map (to_index, axes_front, Tuple (arg))... , to_indices (A, axes_tail, args)... )
238- end
239-
240- @propagate_inbounds function _to_multi_indices (A, f:: Tuple , l:: Tuple , arg, args:: Tuple )
241- return (to_index (_layout (IndexStyle (A), f), arg), to_indices (A, l, args)... )
242- end
243-
244221@propagate_inbounds function to_indices (A, axs:: Tuple , args:: Tuple{} )
245222 @boundscheck if length (first (axs)) != 1
246223 error (" Cannot drop dimension of size $(length (first (axs))) ." )
@@ -254,7 +231,6 @@ to_indices(A, axs::Tuple{}, args::Tuple{}) = ()
254231_maybe_tail (:: Tuple{} ) = ()
255232_maybe_tail (x:: Tuple ) = tail (x)
256233
257-
258234"""
259235 to_index([::IndexStyle, ]axis, arg) -> index
260236
0 commit comments