I had a function which looked like this (showing only the important part):
double CompareShifted(const std::vector& l, const std::vector&
This might be because when you are using the logical operator &&
the compiler has to check two conditions for the if statement to succeed. However in the second case since you are implicitly converting an int value to a bool, the compiler makes some assumptions based on the types and values being passed in, along with (possibly) a single jump condition. It is also possible that the compiler completely optimizes away the jmps with bit shifts.