Skip to content

Instantly share code, notes, and snippets.

@xlc
Last active December 7, 2016 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlc/25204693a064f32d2c98ae9ec7a9152a to your computer and use it in GitHub Desktop.
Save xlc/25204693a064f32d2c98ae9ec7a9152a to your computer and use it in GitHub Desktop.
func someCondition(_: Int) -> Bool {
return true
}
func foo() {
func loop(_ index: Int) {
if (index < 100) {
if someCondition(index) {
return loop(index + 3)
} else {
// body
return loop(index + 1)
}
}
}
loop(0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment