pub fn conditional_swap<T: Clone>(a: &mut T, b: &mut T, condition: bool)
Constant-time conditional swap
Swaps a and b if condition is true, otherwise leaves them unchanged. Does not branch on the condition value.
a
b
condition