refactored foreach() -> forEach() as per Cedric's excellent suggestion http://devnet.jetbrains.net/message/5454105#5454105

This commit is contained in:
James Strachan
2012-03-12 12:07:38 +00:00
parent 5805165793
commit d469710c7c
9 changed files with 13 additions and 13 deletions
@@ -107,7 +107,7 @@ inline fun <T, R> Array<T>.flatMapTo(result: Collection<R>, transform: (T)-> Col
}
/** Performs the given operation on each element inside the collection */
inline fun <T> Array<T>.foreach(operation: (element: T) -> Unit) {
inline fun <T> Array<T>.forEach(operation: (element: T) -> Unit) {
for (elem in this)
operation(elem)
}
@@ -95,7 +95,7 @@ inline fun <T, R> Iterable<T>.flatMapTo(result: Collection<R>, transform: (T)->
}
/** Performs the given operation on each element inside the collection */
inline fun <T> Iterable<T>.foreach(operation: (element: T) -> Unit) {
inline fun <T> Iterable<T>.forEach(operation: (element: T) -> Unit) {
for (elem in this)
operation(elem)
}