Suppose I have an IF
condition :
if (A || B)
∧
|
|
left
{
// do something
}
Now suppose that A
If the expression on the left is true, there is no need to evaluate the expression on the right, and so it can be optimized out at run time. This is a technique called short-circuiting. So by placing the expression more likely to be true on the left, we can expect our program to perform better than if it were the other way around.