julia
julia copied to clipboard
fix `circshift(::Tuple{}, ::Int)`
Fixes circshift for empty tuples.
Fixes #54294
circshift2(t::Tuple{L,R}, shift::Integer) where {L,R} = ifelse(iseven(shift), t, reverse(t))
is a bit faster on my machine than the length-2 implementation added here (just ifelse vs if-else mostly. not sure if the extra type assertions are needed either)
I think ifelse is only a good idea when L == R, otherwise it exacerbates type stability issues. I guess.
ping
ping
ping
ping, this should be very easy to review (don't look at the individual commits)