>>106163390
the most important part is keeping the code readable to reduce the maintenance cost. but in very simple cases, using a simpler version that the compiler can easily understand, may allow the compiler to optimize it better. for example, this could also be compiled as a conditional move instruction, which may be more efficient than the multiplication by a conditional trick.