refactored foreach() -> forEach() as per Cedric's excellent suggestion http://devnet.jetbrains.net/message/5454105#5454105
This commit is contained in:
@@ -199,7 +199,7 @@ inline fun Reader.buffered(): BufferedReader = if(this is BufferedReader) this e
|
||||
|
||||
inline fun Reader.buffered(bufferSize: Int) = BufferedReader(this, bufferSize)
|
||||
|
||||
inline fun Reader.foreachLine(block: (String) -> Unit): Unit {
|
||||
inline fun Reader.forEachLine(block: (String) -> Unit): Unit {
|
||||
this.use{
|
||||
val iter = buffered().lineIterator()
|
||||
while (iter.hasNext) {
|
||||
|
||||
@@ -104,7 +104,7 @@ inline fun <T, R> java.lang.Iterable<T>.flatMapTo(result: Collection<R>, transfo
|
||||
}
|
||||
|
||||
/** Performs the given operation on each element inside the collection */
|
||||
inline fun <T> java.lang.Iterable<T>.foreach(operation: (element: T) -> Unit) {
|
||||
inline fun <T> java.lang.Iterable<T>.forEach(operation: (element: T) -> Unit) {
|
||||
for (elem in this)
|
||||
operation(elem)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user