blob: d51b929ca3405479f8258b84297a37d18cfb4b36 [file] [log] [blame]
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.flatMap{}.firstOrNull{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.flatMap{}.firstOrNull{}'"
fun foo(list: List<String>): String? {
<caret>for ((index, s) in list.withIndex()) {
for (line in s.lines().take(index)) {
if (line.isNotBlank()) return line
}
}
return null
}