2 ms·
When you check for error conditions shortcircuiting is unlikely and thus useless. if(error1|error2)abort();
by GoblinSlayer 5y ago
When you check for error conditions shortcircuiting is unlikely and thus useless.
if(error1|error2)abort();
- anyfoo 5y agoBut it semantically resolves to the exact same, and so the compiler will likely treat it the same and optimize for whatever makes most sense. This may both make a written "a|b" short-circuiting, and a written "a||b" non-short-circuiting, as long as the result stays the same (which for simple bool a,b it always does).