Skip to content

Commit

Permalink
update to N5N3's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Dec 22, 2021
1 parent 8ad4716 commit eaaefb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -905,11 +905,11 @@ end
function copyto!(dest::AbstractArray, dstart::Integer, src)
i = Int(dstart)
if haslength(src)
checkbounds(dest, i)
checkbounds(dest, i + length(src) - 1)
for x in src
@inbounds dest[i] = x
i += 1
I = eachindex(dest)[i]
@inbounds for x in src
dest[I] = x
I = nextind(dest, I)
end
else
for x in src
Expand Down

0 comments on commit eaaefb1

Please sign in to comment.