4 ms·
It’s not the if staments: for an assertion the panic branch should be ice-cold and likely proven by invariants up the stack frame — other assertions or plain ol
by bbatha 7y ago
It’s not the if staments: for an assertion the panic branch should be ice-cold and likely proven by invariants up the stack frame — other assertions or plain old conditionals — so in theory should be optimized away every time. It’s the expression in the condition that’s often expensive. The assert macro eliminates these trivially with the preprocessor , but go cannot as easily because the condition expression may have side effects.