@coded_artist @LukeAlmighty @SuperDicq
Branch misprediction is when it guesses incorrectly, and it costs a lot of time.
If a value used inside an if condition is known some time before the execution reaches the if, that might make branch prediction easier for a sufficiently smart CPU.
But when you obscure which value is which by using arithmetic to swap two variables, the CPU might not be able to see through that, resulting in frequent mispredictions, and making your code slow.
5/