Skip to content

Commit

Permalink
Fix copyto! with #undef
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored Apr 30, 2022
1 parent 65e3316 commit ad1f384
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PooledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ function Base.copyto!(dest::PooledArrOrSub{T, N, R}, doffs::Union{Signed, Unsign
copyto!(DataAPI.refarray(dest), doffs, DataAPI.refarray(src), soffs, n)
else
@inbounds for i in 0:n-1
dest[doffs+i] = src[soffs+i]
if iszero(src[soffs+i])
dest.refs[doffs+i] = zero(eltype(dest.refs))
else
dest[doffs+i] = src[soffs+i]
end
end
end
return dest
Expand Down

0 comments on commit ad1f384

Please sign in to comment.