3 ms·
You're thinking of the '|' operator, which evaluates both arguments. The '||' operator is defined to never evaluate the 2nd if the first is true; its tradition
by JoeAltmaier 12y ago
You're thinking of the '|' operator, which evaluates both arguments. The '||' operator is defined to never evaluate the 2nd if the first is true; its traditionally used exactly for this purpose e.g. if (!p || p->...) or more likely if (p && p->IsGood(...))
{edit: false -> true}
- xedarius 12y agoI have to put my hand up here and admit I got over excited and I was wrong. Thanks for correcting me.