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

9 lines
384 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'flatMap{}.filterNot{}.mapIndexedTo(){}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().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 }
}