blob: dee2835d67de7e3e83dc8b09751feb57065e0a01 [file] [log] [blame]
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.firstOrNull{}'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.firstOrNull{}'"
fun foo(list: List<String>): Int? {
<caret>for ((index, s) in list.withIndex()) {
val x = s.length * index
if (x > 0) return x
}
return null
}