Skip to content

Commit b6a1411

Browse files
some optimizations to use deepcopy less
1 parent af39294 commit b6a1411

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ end
8080
end
8181
else
8282
if perform_copy
83-
push!(a,deepcopy(x))
83+
if typeof(x) <: Vector && !(eltype(x) <: Number) && !(eltype(x) <: StaticArray)
84+
push!(a,recursivecopy(x))
85+
elseif typeof(x) <: ArrayPartition || typeof(x) <: AbstractVectorOfArray
86+
push!(a,copy(x))
87+
else
88+
push!(a,deepcopy(x))
89+
end
8490
else
8591
push!(a,x)
8692
end

0 commit comments

Comments
 (0)