"Use withIndex()" intention&inspection

This commit is contained in:
Valentin Kipyatkov
2016-05-13 17:02:40 +03:00
parent 46055dfd2d
commit d658d3b9cf
23 changed files with 248 additions and 15 deletions
@@ -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) }
}