You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure this is a good lint - in many cases I do this to reduce the level of nesting. Also, having early breaks/continues makes the code easier to follow.
Right the situation is different if you have a lot of code afterwards, but if the loop-body is very short, having the one statement inside the if or outside of it makes no difference in regards of the amount of nesting imo. ^^
I feel this would be the kind of lint easily ignored by users since it's hard to nail down what's a "big" loop (even if we make the number of line a user setting)
What it does
suggest replacing
if cond { continue } <code>
inside a loop with justif !cond { <code> }
Lint Name
?
Category
suspicious, complexity
Advantage
simplify code
Drawbacks
No response
Example
Could be written as:
The text was updated successfully, but these errors were encountered: