StdLib deprecations cleanup: length, size, indices and other collection operations.
This commit is contained in:
@@ -1064,7 +1064,7 @@ public inline fun <T, C : MutableCollection<in T>> Stream<T>.filterTo(destinatio
|
||||
* Appends all characters matching the given [predicate] to the given [destination].
|
||||
*/
|
||||
public inline fun <C : Appendable> String.filterTo(destination: C, predicate: (Char) -> Boolean): C {
|
||||
for (index in 0..length - 1) {
|
||||
for (index in 0..length() - 1) {
|
||||
val element = get(index)
|
||||
if (predicate(element)) destination.append(element)
|
||||
}
|
||||
@@ -1819,7 +1819,7 @@ public fun <T> Stream<T>.takeWhile(predicate: (T) -> Boolean): Stream<T> {
|
||||
* Returns a string containing the first characters that satisfy the given [predicate].
|
||||
*/
|
||||
public inline fun String.takeWhile(predicate: (Char) -> Boolean): String {
|
||||
for (index in 0..length - 1)
|
||||
for (index in 0..length() - 1)
|
||||
if (!predicate(get(index))) {
|
||||
return substring(0, index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user