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

10 lines
299 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'map{}.firstOrNull{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.firstOrNull{}'"
fun foo(list: List<String>): Int? {
<caret>for (s in list) {
val length = s.length
if (length > 0) return length
}
return null
}