Sometimes shorter code with filterTo, mapTo and flatMapTo
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
import java.util.ArrayList
|
||||
|
||||
fun foo(list: List<String>): List<String> {
|
||||
<caret>val target = list.flatMapTo(ArrayList<String>(100)) { it.lines() }
|
||||
return target
|
||||
}
|
||||
Reference in New Issue
Block a user