Skip to content

Commit eaaefb1

Browse files
committed
update to N5N3's suggestion
1 parent 8ad4716 commit eaaefb1

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
@@ -905,11 +905,11 @@ end
905905
function copyto!(dest::AbstractArray, dstart::Integer, src)
906906
i = Int(dstart)
907907
if haslength(src)
908-
checkbounds(dest, i)
909908
checkbounds(dest, i + length(src) - 1)
910-
for x in src
911-
@inbounds dest[i] = x
912-
i += 1
909+
I = eachindex(dest)[i]
910+
@inbounds for x in src
911+
dest[I] = x
912+
I = nextind(dest, I)
913913
end
914914
else
915915
for x in src

0 commit comments

Comments
 (0)