Files
kotlin-fork/idea/testData/intentions/loopToCallChain/map/mapIndexed.kt.after
T
2016-08-23 22:47:42 +03:00

8 lines
310 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.firstOrNull{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.firstOrNull{}'"
fun foo(list: List<String>): Int? {
<caret>return list
.mapIndexed { index, s -> s.length * index }
.firstOrNull { it > 0 }
}