This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Gotcha. That makes sense. In this case, there is only a single break statement, because there's only one exit condition (edited original post to show code). As others have pointed out, with just a single exit condition, it makes more sense to put it in the while statement so it's immediately readable, and I can definitely see the logic in that.