Files
kotlin-fork/idea/testData/intentions/loopToCallChain/indexWithNestedLoop.kt.after
T
2016-08-16 17:38:07 +03:00

8 lines
294 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'flatMap{}.filterNot{}.mapIndexedTo(){}'"
fun foo(list: List<String>, target: MutableCollection<Int>) {
<caret>list
.flatMap { it.indices }
.filterNot { it == 10 }
.mapIndexedTo(target) { i, j -> i + j }
}