I was reviewing some Java code with this line
if ( list.size() == 1 || list.size() <= 4) {...}
I commented that I do not see how that is any different from just doing
if (list.size() <= 4) {...}
he said it matters and needs to be the first. I don't understand. Perhaps if it were something like
if (list.size() == 1 || list.size() <= someVeryCostlyFunction() ) {...}
and the size was expected to be 1 most of the time you might use both, if someVeryCostlyFunction() always returns some positive number >= 1. Otherwise I can't see the difference. We are supposed to check for efficiency.