Files
kotlin-fork/idea/testData/intentions/loopToCallChain/prefixIndexPlusPlusInsideExpression.kt.after
T

8 lines
290 B
Plaintext
Vendored

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