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)]