In-place reversing.
#KT-9034
This commit is contained in:
@@ -789,6 +789,13 @@ public inline fun <T> Iterable<T>.takeWhile(predicate: (T) -> Boolean): List<T>
|
||||
return list
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses elements in the collection in-place.
|
||||
*/
|
||||
public fun <T> MutableList<T>.reverse(): Unit {
|
||||
java.util.Collections.reverse(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list with elements in reversed order.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user