How can I rewrite this (cleanly) without gotos?
- by Jared P
How can I do this cleanly without gotos?
loop:
if(condition1){
something();
} else if (condition2) {
somethingDifferent();
} else {
mostOfTheWork();
goto loop;
}
I'd prefer not to use breaks as well. Furthermore, it is expected to loop several (adv 40) times before doing something else, so the mostOfTheWork part would most likely be as high up as possible, even if just for readability. Thanks in advance.