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

9 lines
326 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapNotNull{}.mapTo(){}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapNotNull{}.mapTo(){}'"
fun foo(list: List<String?>, target: MutableList<String>) {
<caret>for (s in list) {
val length = s?.length ?: continue
target.add(length.toString())
}
}