Skip to content

Commit

Permalink
Typo fix. (#45333)
Browse files Browse the repository at this point in the history
(cherry picked from commit eed2dba)
  • Loading branch information
N5N3 authored and KristofferC committed May 23, 2022
1 parent 427daf1 commit 42f7a99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ function copyto!(dest::AbstractArray{T1,N}, Rdest::CartesianIndices{N},
if @generated
quote
@nloops $N i (n->CRsrc.indices[n]) begin
@inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src,n->Rsrc.indices[n][i_n])
@inbounds @nref($N,dest,n->Rdest.indices[n][i_n+ΔI[n]]) = @nref($N,src,n->Rsrc.indices[n][i_n])
end
end
else
Expand Down
4 changes: 4 additions & 0 deletions test/copy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ end
@test all(iszero, B)
end
end
let A = [reshape(1:6, 3, 2);;]
copyto!(A, CartesianIndices((2:3,2)), A, CartesianIndices((2,2)))
@test A[2:3,:] == [1 4;2 5]
end
end

@testset "shallow and deep copying" begin
Expand Down

0 comments on commit 42f7a99

Please sign in to comment.