Introduce "Redundant 'asSequence' call" inspections
#KT-35893 Fixed
This commit is contained in:
committed by
igoriakovlev
parent
e2c3455445
commit
afd544cbab
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.collections.RedundantAsSequenceInspection
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list/*comment*/.<caret>asSequence().last()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list/*comment*/.last()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list
|
||||
// comment
|
||||
.<caret>asSequence()
|
||||
.max()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list
|
||||
// comment
|
||||
.max()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list.<caret>sorted().first()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>?) {
|
||||
list?.<caret>asSequence()?.first()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>?) {
|
||||
list?.first()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list.<caret>asSequence().all { it.isBlank() }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
list.all { it.isBlank() }
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(set: Set<String>) {
|
||||
set.<caret>asSequence().any { it.isBlank() }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(set: Set<String>) {
|
||||
set.any { it.isBlank() }
|
||||
}
|
||||
Reference in New Issue
Block a user