@@ -380,19 +380,19 @@ compute_offset1(parent::AbstractVector, stride1::Integer, I::Tuple{AbstractRange
380380# indexing uses the indices along the given dimension.
381381# If the result is one-dimensional and it's a range, then linear
382382# indexing might be offset if the index itself is offset
383- # Otherwise linear indexing always starts with 1 .
383+ # Otherwise linear indexing always matches the parent .
384384compute_offset1 (parent, stride1:: Integer , I:: Tuple ) =
385385 (@_inline_meta ; compute_offset1 (parent, stride1, find_extended_dims (1 , I... ), find_extended_inds (I... ), I))
386386compute_offset1 (parent, stride1:: Integer , dims:: Tuple{Int} , inds:: Tuple{Slice} , I:: Tuple ) =
387387 (@_inline_meta ; compute_linindex (parent, I) - stride1* first (axes (parent, dims[1 ]))) # index-preserving case
388388compute_offset1 (parent, stride1:: Integer , dims, inds:: Tuple{AbstractRange} , I:: Tuple ) =
389389 (@_inline_meta ; compute_linindex (parent, I) - stride1* first (axes1 (inds[1 ]))) # potentially index-offsetting case
390390compute_offset1 (parent, stride1:: Integer , dims, inds, I:: Tuple ) =
391- (@_inline_meta ; compute_linindex (parent, I) - stride1) # linear indexing starts with 1
391+ (@_inline_meta ; compute_linindex (parent, I) - stride1)
392392function compute_linindex (parent, I:: NTuple{N,Any} ) where N
393393 @_inline_meta
394394 IP = fill_to_length (axes (parent), OneTo (1 ), Val (N))
395- compute_linindex (1 , 1 , IP, I)
395+ compute_linindex (first ( LinearIndices (parent)) , 1 , IP, I)
396396end
397397function compute_linindex (f, s, IP:: Tuple , I:: Tuple{ScalarIndex, Vararg{Any}} )
398398 @_inline_meta
0 commit comments