Skip to content

Commit 122eb8c

Browse files
Merge pull request #245 from SciML/ChrisRackauckas-patch-1
Remove unnecessary val-type in `copyat_or_push!`
2 parents 5851532 + 9940523 commit 122eb8c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ copyat_or_push!{T}(a::AbstractVector{T},i::Int,x)
148148
149149
If `i<length(x)`, it's simply a `recursivecopy!` to the `i`th element. Otherwise, it will
150150
`push!` a `deepcopy`.
151-
"""
152-
function copyat_or_push!(a::AbstractVector{T},i::Int,x,nc::Type{Val{perform_copy}}=Val{true}) where {T,perform_copy}
151+
"""
152+
function copyat_or_push!(a::AbstractVector{T},i::Int,x,perform_copy=true) where {T}
153153
@inbounds if length(a) >= i
154154
if !ArrayInterfaceCore.ismutable(T) || !perform_copy
155155
# TODO: Check for `setindex!`` if T <: StaticArraysCore.StaticArray and use `copy!(b[i],a[i])`
@@ -171,7 +171,11 @@ function copyat_or_push!(a::AbstractVector{T},i::Int,x,nc::Type{Val{perform_copy
171171
end
172172
nothing
173173
end
174-
174+
175+
function copyat_or_push!(a::AbstractVector{T},i::Int,x,nc::Type{Val{perform_copy}}) where {T, perform_copy}
176+
copyat_or_push!(a,i,x,perform_copy)
177+
end
178+
175179
"""
176180
```julia
177181
recursive_one(a)

0 commit comments

Comments
 (0)