Skip to content

Commit 5b83d5c

Browse files
committed
Update comments
1 parent 75928e1 commit 5b83d5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

base/abstractarray.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
11331133
end
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
11371138
function __copyto!(dest::A, ::A, dstart, src::B, ::B, sstart, n) where {A,B}
11381139
@_propagate_inbounds_meta
11391140
_copyto!(dest, dstart, src, sstart, n)
11401141
end
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
11421143
function __copyto!(_, destp, dstart, _, srcp, sstart, n)
11431144
@_propagate_inbounds_meta
11441145
copyto!(destp, dstart, srcp, sstart, n)

0 commit comments

Comments
 (0)