@@ -1131,14 +1131,15 @@ function copyto!(dest::AbstractArray, dstart::Integer,
11311131 # if no, then fall back to the default implementation that loops over the arrays
11321132 __copyto! (dest, _unwrap_view (dest, dstart)... , src, _unwrap_view (src, sstart)... , n)
11331133end
1134- # if the array A is not a view, there's nothig to unwrap
1134+ # `_unwrap_view` potentially unwraps a SubArray and shifts the index `ind` by the linear offset of the view
1135+ # If the array `A` is not a view, there's nothing to unwrap
11351136_unwrap_view (A, ind) = A, ind
1136- # fallback method if the arrays aren't views , in which case there's nothing to unwrap
1137+ # fallback method if neither array is a SubArray , in which case we loop over them
11371138function __copyto! (dest:: A , :: A , dstart, src:: B , :: B , sstart, n) where {A,B}
11381139 @_propagate_inbounds_meta
11391140 _copyto! (dest, dstart, src, sstart, n)
11401141end
1141- # try copying to the parents if there is at least one contiguous view
1142+ # Forward the copy to the parent if there is any contiguous, linearly indexed view
11421143function __copyto! (_, destp, dstart, _, srcp, sstart, n)
11431144 @_propagate_inbounds_meta
11441145 copyto! (destp, dstart, srcp, sstart, n)
0 commit comments