Which would be more efficient?
if(foo != 0)
{
bar += foo;
}
or
bar += foo;
Assuming foo could have a decent chance of being 0 (say 25% but could make other assumptions on percentage, obviously 0% would mean the latter is always more efficient)
Is there a concensus on when you should use one over the other, or do people do things like profiling to determine the actual more efficient expression?