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

13 lines
295 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'filter{}.mapTo(){}'"
import java.util.ArrayList
fun foo(list: List<String>): List<Int> {
val target = ArrayList<Int>(100)
<caret>for (s in list) {
if (s.length > 0)
target.add(s.hashCode())
}
return target
}