Skip to content

Commit 8597c9a

Browse files
committed
update to N5N3's suggestion
1 parent b50992f commit 8597c9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/abstractarray.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,11 +915,11 @@ end
915915
function copyto!(dest::AbstractArray, dstart::Integer, src)
916916
i = Int(dstart)
917917
if haslength(src)
918-
checkbounds(dest, i)
919918
checkbounds(dest, i + length(src) - 1)
920-
for x in src
921-
@inbounds dest[i] = x
922-
i += 1
919+
I = eachindex(dest)[i]
920+
@inbounds for x in src
921+
dest[I] = x
922+
I = nextind(dest, I)
923923
end
924924
else
925925
for x in src

0 commit comments

Comments
 (0)