Inspectopedia
 
2024.3

Unused loop index

Warning
New
Last modified: 03 December 2024

Reports for loops iterating over a collection using the withIndex() function and not using the index variable.

Use the "Remove indices in 'for' loop" quick-fix to clean up the code.

Examples:

After the quick-fix is applied: