Recognizing manually incremented index

This commit is contained in:
Valentin Kipyatkov
2016-04-21 13:40:03 +03:00
parent 14e87b1f2c
commit d61daed461
23 changed files with 283 additions and 37 deletions
@@ -0,0 +1,12 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with '+= ...filterNot{}.mapIndexed{}'"
fun foo(list: List<String>, target: MutableCollection<Int>) {
var i = 0
<caret>for (s in list) {
for (j in s.indices) {
if (j == 10) continue
target.add(i + j)
i++
}
}
}