Use reverse indexed iteration in last and lastOrNull with predicate for CharSequences and Strings.

This commit is contained in:
Ilya Gorbunov
2015-10-28 21:55:51 +03:00
parent 8c16fad8b1
commit 0dd7e398c7
2 changed files with 18 additions and 32 deletions
@@ -643,7 +643,7 @@ fun elements(): List<GenericFunction> {
"""
}
body(ArraysOfPrimitives, ArraysOfObjects, Lists) {
body(CharSequences, Strings, ArraysOfPrimitives, ArraysOfObjects, Lists) {
"""
for (index in this.indices.reversed()) {
val element = this[index]
@@ -678,7 +678,7 @@ fun elements(): List<GenericFunction> {
"""
}
body(ArraysOfPrimitives, ArraysOfObjects, Lists) {
body(CharSequences, Strings, ArraysOfPrimitives, ArraysOfObjects, Lists) {
"""
for (index in this.indices.reversed()) {
val element = this[index]