StdLib deprecations cleanup: length, size, indices and other collection operations.

This commit is contained in:
Ilya Gorbunov
2015-06-25 18:36:52 +03:00
parent 2c31a1a345
commit f3a19ebe11
11 changed files with 42 additions and 42 deletions
+2 -2
View File
@@ -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)
}