Files
kotlin-fork/idea/testData/intentions/loopToCallChain/maxMin/max6.kt.after
T
2021-04-07 07:49:23 +03:00

11 lines
326 B
Plaintext
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'mapIndexed{}.maxOrNull()'"
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.maxOrNull()'"
fun getMaxLineWidth(list: List<Double>): Double {
val <caret>max = list
.mapIndexed { i, item -> item * i }
.maxOrNull()
?: 0.0
return max
}