Skip to content

Commit b418cc2

Browse files
committed
Update comments
1 parent 47bac98 commit b418cc2

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
@@ -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)
11341134
end
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
11381139
function __copyto!(dest::A, ::A, dstart, src::B, ::B, sstart, n) where {A,B}
11391140
@_propagate_inbounds_meta
11401141
_copyto!(dest, dstart, src, sstart, n)
11411142
end
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
11431144
function __copyto!(_, destp, dstart, _, srcp, sstart, n)
11441145
@_propagate_inbounds_meta
11451146
copyto!(destp, dstart, srcp, sstart, n)

0 commit comments

Comments
 (0)