Files
kotlin-fork/idea/testData/intentions/loopToCallChain/flatMapWithBreak.kt
T
2016-08-16 17:38:02 +03:00

15 lines
370 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'flatMap{}.firstOrNull{}'"
fun foo(list: List<String>): String? {
var result: String? = null
MainLoop@
<caret>for (s in list) {
for (line in s.lines()) {
if (line.isNotBlank()) {
result = line
break@MainLoop
}
}
}
return result
}