"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
@@ -0,0 +1,11 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(list: List<String>): Int? {
var index = 0
<caret>for ((i, s) in list.withIndex()) {
val x = s.length * index * i
index++
if (x > 0) return x
}
return null
}