15 ms·
It might be used to avoid a conditional.
by noselasd 10y ago
It might be used to avoid a conditional.
- column 10y agoThank you for your answer but frankly I don't understand it. Could you please elaborate?
- noselasd 10y agoGenerally multiplying with 1 can be used to just do (the equivalent in assembly of): a = a * b; instead of if (b != 1) a = a * b; Which is normally a win, as branching are expensive vs multiplication.