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

10 lines
423 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
.asSequence()
.flatMap { it.indices.asSequence() }
.filterNot { it == 10 }
.mapIndexedTo(target) { i, j -> i + j }
}