Useless call on collection: propose 'Replace with toList()' instead of 'Remove useless call' if receiver is array type
#KT-38961 Fixed
This commit is contained in:
committed by
Nikita Bobko
parent
994897cee9
commit
081d6c1dff
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x: List<String> = arrayOf("1").<caret>filterIsInstance<String>()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x: List<String> = arrayOf("1").toList()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x: List<String> = arrayOf("1").<caret>filterNotNull()
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x: List<String> = arrayOf("1").toList()
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(iterable: Iterable<Int>): List<Int> {
|
||||
return iterable.<caret>filterNotNull()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(iterable: Iterable<Int>): List<Int> {
|
||||
return iterable.toList()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(): List<Int> {
|
||||
return setOf(1).<caret>filterNotNull()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(): List<Int> {
|
||||
return setOf(1).toList()
|
||||
}
|
||||
Reference in New Issue
Block a user