Added inspection based on RemoveForLoopIndicesIntention

This commit is contained in:
Valentin Kipyatkov
2015-07-21 14:04:51 +03:00
parent 6b0fc8391f
commit 6339ad4ec6
10 changed files with 32 additions and 10 deletions
@@ -0,0 +1,5 @@
<html>
<body>
This inspection reports for loops iterating over a collection of values using "withIndex()" function with index variable not used in the loop body.
</body>
</html>
@@ -1,3 +1,3 @@
for ((i, x) in foo.withIndices()) {
for (<spot>(i, x) in foo.withIndices()</spot>) {
}
@@ -1,3 +1,3 @@
for (x in foo) {
for (<spot>x in foo</spot>) {
}
@@ -1,3 +1,3 @@
for (x in foo) {
for (<spot>x in foo</spot>) {
}
@@ -1,3 +1,3 @@
for ((i, x) in foo.withIndices()) {
for (<spot>(i, x) in foo.withIndices()</spot>) {
}