Skip to content

Commit

Permalink
Simplify first index Union in FastContiguousSubArray definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Nov 7, 2024
1 parent 671cd5e commit b1d661e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/subarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ end

# We can avoid a multiplication if the first parent index is a Colon or AbstractUnitRange,
# or if all the indices are scalars, i.e. the view is for a single value only
FastContiguousSubArray{T,N,P,I<:Union{Tuple{Union{Slice, AbstractUnitRange}, Vararg{Any}},
FastContiguousSubArray{T,N,P,I<:Union{Tuple{AbstractUnitRange, Vararg{Any}},
Tuple{Vararg{ScalarIndex}}}} = SubArray{T,N,P,I,true}

@inline _reindexlinear(V::FastContiguousSubArray, i::Int) = V.offset1 + i
Expand Down

0 comments on commit b1d661e

Please sign in to comment.