News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by michaeljbishop on Monday March 26, 2018 @09:56AM (#16678879)
How to do this in a for-loop:

  for (int 1 = 0; i < length; i++) {
    if (checkError(i))
      continue;
  
    ... // happy path
  }
You can also use a return statement inside the for-loop if you want to exit the entire function.

There are no comments on this comment yet.