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
3656
3656
# # 1-d circshift ##
3657
3657
function circshift! (a:: AbstractVector , shift:: Integer )
3658
3658
n = length (a)
3659
- n == 0 && return
3659
+ n == 0 && return a
3660
3660
shift = mod (shift, n)
3661
- shift == 0 && return
3661
+ shift == 0 && return a
3662
3662
l = lastindex (a)
3663
3663
reverse! (a, firstindex (a), l- shift)
3664
3664
reverse! (a, l- shift+ 1 , lastindex (a))
Original file line number Diff line number Diff line change 797
797
oa = OffsetVector (copy (a), - 1 )
798
798
@test circshift! (oa, 1 ) === oa
799
799
@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
800
808
end
801
809
802
810
@testset " circcopy" begin
You can’t perform that action at this time.
0 commit comments