Files
kotlin-fork/idea/testData/intentions/loopToCallChain/mapNotNullTo.kt
T
Valentin Kipyatkov 2652ea4233 Supported mapNotNullTo
2016-08-16 17:38:07 +03:00

9 lines
257 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapNotNullTo(){}'"
fun foo(list: List<String?>, target: MutableList<Int>) {
<caret>for (s in list) {
val length = s?.length
if (length == null) continue
target.add(length)
}
}