Initial support for "+=", filterTo and mapTo for collections
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<String>) {
|
||||
<caret>for (s in list) {
|
||||
target.add(s)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<String>) {
|
||||
<caret>target += list
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<String>) {
|
||||
<caret>for (s in list) {
|
||||
if (s.length > 0)
|
||||
target.add(s)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<String>) {
|
||||
list.filterTo(target) { it.length > 0 }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<Int>) {
|
||||
<caret>for (s in list) {
|
||||
if (s.length > 0)
|
||||
target.add(s.hashCode())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun foo(list: List<String>, target: MutableList<Int>) {
|
||||
<caret>list
|
||||
.filter { it.length > 0 }
|
||||
.mapTo(target) { it.hashCode() }
|
||||
}
|
||||
Reference in New Issue
Block a user