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

10 lines
351 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
if (length == null) continue
target.add(length.toString())
}
}