View Single Post
Old 05-14-2022, 06:33 AM   #10
juan_r
Human being with feelings
 
juan_r's Avatar
 
Join Date: Oct 2019
Posts: 1,075
Default

Quote:
Originally Posted by mschnell View Post
Yep. In certain cases you additionally need to "?" check that variable to jump over the rest of the loop.

A "break" instruction might be slightly faster in certain cases.
-Michael
Apart from efficiency (that an optimizing compiler could at least partially re-gain), the matter is that of ease of coding - legibility and such. An additional '?' yields one more level of nesting and a whole bunch of hairy "dangling else" dangers. I mean: skipping the rest of the current iteration can't be done without more nesting since we have no GOTO (and rightly so, IMHO).
juan_r is offline   Reply With Quote