Skip to content

Instantly share code, notes, and snippets.

@invernizzie
Created February 14, 2012 18:39
Show Gist options
  • Select an option

  • Save invernizzie/1828984 to your computer and use it in GitHub Desktop.

Select an option

Save invernizzie/1828984 to your computer and use it in GitHub Desktop.
def eachUntil = { collection, Closure condition, Closure closure ->
for (value in collection) {
if (condition()) break
closure(value)
}
}
topTracks?.eachUntil ({ video.size() >= 10 }, {trackName ->
// Hacer algo X
videos << trackVideo
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment