Skip to content

Commit

Permalink
Always return a value in 1-d circshift! of abstractarray.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
erich-9 committed Mar 2, 2024
1 parent 2b95956 commit a0dd415
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3656,9 +3656,9 @@ end
## 1-d circshift ##
function circshift!(a::AbstractVector, shift::Integer)
n = length(a)
n == 0 && return
n == 0 && return a
shift = mod(shift, n)
shift == 0 && return
shift == 0 && return a
l = lastindex(a)
reverse!(a, firstindex(a), l-shift)
reverse!(a, l-shift+1, lastindex(a))
Expand Down

0 comments on commit a0dd415

Please sign in to comment.