From b1d661ee97c83d7f9ea6202ee5df2eee4c9cbe9c Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Thu, 7 Nov 2024 20:09:25 +0530 Subject: [PATCH] Simplify first index Union in FastContiguousSubArray definition --- base/subarray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/subarray.jl b/base/subarray.jl index 47b4fa0584dba..d6ddf7786f7ec 100644 --- a/base/subarray.jl +++ b/base/subarray.jl @@ -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