Created
April 4, 2013 16:27
-
-
Save anonymous/5311870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool for_switch_state_machine_wtf() { | |
int state = 1 | |
for(;;) { | |
switch(state) { | |
case 1: | |
if (!do_some_stuff()) | |
return false; | |
state = 2; | |
break; | |
case 2: | |
if (!do_some_other_stuff()) | |
return false; | |
return true; | |
default: | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment