From c264348f04dee4029966a12130d1c4e365d0df05 Mon Sep 17 00:00:00 2001 From: Amin Date: Thu, 6 Jan 2022 02:51:12 -0500 Subject: [PATCH] Minor refactor of vector_of_arrays.jl --- src/vector_of_array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index eedc514c..9515ad1d 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -77,7 +77,7 @@ Base.@propagate_inbounds function Base.getindex(A::AbstractVectorOfArray{T, N}, I::AbstractArray{Bool},J::Colon...) where {T, N} @assert length(J) == ndims(A.u[1])+1-ndims(I) @assert size(I) == size(A)[1:ndims(A)-length(J)] - return A[repeat([:], length(size(A)))...][I,J...] + return A[ntuple(x -> Colon(), ndims(A))...][I, J...] end Base.@propagate_inbounds Base.getindex(A::AbstractDiffEqArray{T, N}, i::Int,::Colon) where {T, N} = [A.u[j][i] for j in 1:length(A)]