10 lines
299 B
Kotlin
Vendored
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) {
|
|
var length = s.length
|
|
if (length > 0) return length
|
|
}
|
|
return null
|
|
} |