Skip to content

Commit

Permalink
Typo fix. (#45333)
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 authored May 17, 2022
1 parent bad3e39 commit eed2dba
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 @@ -1119,7 +1119,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 eed2dba

Please sign in to comment.