diff --git a/base/abstractarray.jl b/base/abstractarray.jl index ad70b973ab10b..bb4aff0f6a411 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -1096,11 +1096,8 @@ function copyto_unaliased!(deststyle::IndexStyle, dest::AbstractArray, srcstyle: end else # Dual-iterator implementation - ret = iterate(iterdest) - @inbounds for a in src - idx, state = ret::NTuple{2,Any} - dest[idx] = a - ret = iterate(iterdest, state) + for (Idest, Isrc) in zip(iterdest, itersrc) + @inbounds dest[Idest] = src[Isrc] end end end