Inspectopedia
 
2024.3

Early loop exit in 'if' condition

Warning
New
Last modified: 03 December 2024

Reports loops with an if statement that can end with break without changing the semantics. This prevents redundant loop iterations.

Example:

After the quick-fix is applied:

New in 2019.2