File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3656,9 +3656,9 @@ end
36563656# # 1-d circshift ##
36573657function circshift! (a:: AbstractVector , shift:: Integer )
36583658 n = length (a)
3659- n == 0 && return
3659+ n == 0 && return a
36603660 shift = mod (shift, n)
3661- shift == 0 && return
3661+ shift == 0 && return a
36623662 l = lastindex (a)
36633663 reverse! (a, firstindex (a), l- shift)
36643664 reverse! (a, l- shift+ 1 , lastindex (a))
Original file line number Diff line number Diff line change 797797 oa = OffsetVector (copy (a), - 1 )
798798 @test circshift! (oa, 1 ) === oa
799799 @test oa == circshift (OffsetVector (a, - 1 ), 1 )
800+
801+ # 1d circshift! (#53554)
802+ a = []
803+ @test circshift! (a, 1 ) === a
804+ @test circshift! (a, 1 ) == []
805+ a = [1 : 5 ;]
806+ @test circshift! (a, 10 ) === a
807+ @test circshift! (a, 10 ) == 1 : 5
800808end
801809
802810@testset " circcopy" begin
You can’t perform that action at this time.
0 commit comments