julia icon indicating copy to clipboard operation
julia copied to clipboard

fix `circshift(::Tuple{}, ::Int)`

Open nsajko opened this issue 1 year ago • 4 comments

Fixes circshift for empty tuples.

Fixes #54294

nsajko avatar Apr 28 '24 19:04 nsajko

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)

adienes avatar Apr 29 '24 14:04 adienes

I think ifelse is only a good idea when L == R, otherwise it exacerbates type stability issues. I guess.

nsajko avatar Apr 29 '24 15:04 nsajko

ping

nsajko avatar May 06 '24 21:05 nsajko

ping

nsajko avatar May 18 '24 19:05 nsajko

ping

nsajko avatar May 31 '24 03:05 nsajko

ping, this should be very easy to review (don't look at the individual commits)

nsajko avatar Jun 08 '24 11:06 nsajko