-
-
Notifications
You must be signed in to change notification settings - Fork 461
Rule proposal: no-for-loop #49
Copy link
Copy link
Closed
Labels
🎁 Rewarded on IssuehuntThis issue has been rewarded on IssuehuntThis issue has been rewarded on Issuehuntenhancementhelp wanted
Metadata
Metadata
Assignees
Labels
🎁 Rewarded on IssuehuntThis issue has been rewarded on IssuehuntThis issue has been rewarded on Issuehuntenhancementhelp wanted
There's no reason to use normal
forloops anymore for the common case.The following:
Can now be written as:
Off-by-one errors is one of the most common bugs in software. Swift actually removed this completely from the language.
We could probably ignore reverse loops and other cases, but the common case like above is better written in the latter form.
@kevva @SamVerschueren @jfmengels @jamestalmage Thoughts?