"Use withIndex()" intention&inspection
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'forEachIndexed{}'"
|
||||
// IS_APPLICABLE: false
|
||||
fun foo(list: List<String>) {
|
||||
<caret>for ((index, s) in list.withIndex()) {
|
||||
println(s.hashCode() * index)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'forEachIndexed{}'"
|
||||
fun foo(list: List<String>) {
|
||||
list.forEachIndexed { index, s -> println(s.hashCode() * index) }
|
||||
}
|
||||
Reference in New Issue
Block a user