Skip to content

Instantly share code, notes, and snippets.

@kwalrath
Last active August 29, 2015 14:26
Show Gist options
  • Save kwalrath/7417291c1fd6c74b56be to your computer and use it in GitHub Desktop.
Save kwalrath/7417291c1fd6c74b56be to your computer and use it in GitHub Desktop.
break_continue
bool shutDownRequested() => true;
processIncomingRequests() {}
class Candidate {
var yearsExperience = 2;
interview() {}
}
main() {
while (true) {
if (shutDownRequested()) break;
processIncomingRequests();
}
var candidates = [new Candidate(), new Candidate(), new Candidate()];
for (int i = 0; i < candidates.length; i++) {
var candidate = candidates[i];
if (candidate.yearsExperience < 5) {
continue;
}
candidate.interview();
}
candidates.where((c) => c.yearsExperience >= 5)
.forEach((c) => c.interview());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment