Don't cook spaghetti and extract your loops into the function:
void foo(...) {
while (...) {
/* some code... */
while (...) {
if ( /* this loop should stop */ )
break;
if ( /* both loops should stop */ )
return;
}
/* more code... */
}
}
this decomposition will also yield cleaner code since instead of hundreds of lines of ugly procedural code, you will have neat functions at different levels of abstraction.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…