On both counts.
First, if (x) if (y) is identical to if (x && y). Any programmer who wants to put something between if (x) and if (y) isn't going to be slowed down much by the second construct.
Second, although in most cases efficiency doesn't matter, there are cases where it does. For example, in this code, you might want to use static branch prediction (if your compiler supports it), since in most cases, the abort is going to be very unlikely. If this code is called a lot, then that static branch prediction could save you quite a bit of execution time with the processor stalled due to a branch prediction error. Especially on poorly designed processors (read Pentium 4) with 20 stage pipelines. |