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