@@ -380,19 +380,19 @@ compute_offset1(parent::AbstractVector, stride1::Integer, I::Tuple{AbstractRange
380
380
# indexing uses the indices along the given dimension.
381
381
# If the result is one-dimensional and it's a range, then linear
382
382
# 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 .
384
384
compute_offset1 (parent, stride1:: Integer , I:: Tuple ) =
385
385
(@_inline_meta ; compute_offset1 (parent, stride1, find_extended_dims (1 , I... ), find_extended_inds (I... ), I))
386
386
compute_offset1 (parent, stride1:: Integer , dims:: Tuple{Int} , inds:: Tuple{Slice} , I:: Tuple ) =
387
387
(@_inline_meta ; compute_linindex (parent, I) - stride1* first (axes (parent, dims[1 ]))) # index-preserving case
388
388
compute_offset1 (parent, stride1:: Integer , dims, inds:: Tuple{AbstractRange} , I:: Tuple ) =
389
389
(@_inline_meta ; compute_linindex (parent, I) - stride1* first (axes1 (inds[1 ]))) # potentially index-offsetting case
390
390
compute_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)
392
392
function compute_linindex (parent, I:: NTuple{N,Any} ) where N
393
393
@_inline_meta
394
394
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)
396
396
end
397
397
function compute_linindex (f, s, IP:: Tuple , I:: Tuple{ScalarIndex, Vararg{Any}} )
398
398
@_inline_meta
0 commit comments