Files
kotlin-fork/idea/testData/intentions/loopToCallChain/maxMin/KT14210.kt
T
2016-10-24 18:32:02 +03:00

10 lines
298 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'filter{}.max()'"
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
fun f(list: List<Int>) {
var result = -1
<caret>for (item in list)
if (item % 2 == 0)
if (result <= item)
result = item
}