Skip to content

Commit

Permalink
fallback in copyat_or_push! to pushing to i if not correctly sized
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jan 24, 2022
1 parent 55c1dca commit 569a07e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RecursiveArrayTools"
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
authors = ["Chris Rackauckas <[email protected]>"]
version = "2.24.0"
version = "2.24.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
6 changes: 5 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function copyat_or_push!(a::AbstractVector{T},i::Int,x,nc::Type{Val{perform_copy
# or `b[i] = a[i]`, see https://github.com/JuliaDiffEq/RecursiveArrayTools.jl/issues/19
a[i] = x
else
recursivecopy!(a[i],x)
if length(a[i]) == length(x)
recursivecopy!(a[i],x)
else
a[i] = recursivecopy(x)
end
end
else
if perform_copy
Expand Down

0 comments on commit 569a07e

Please sign in to comment.