-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review the current usage of each
#109
Milestone
Comments
AFAICT
|
Should we add a section on this to https://www.quattor.org/development/coding_style.html ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
each
is evil, and altough it can be used correctly, should be avoided at all costs. after learning the lesson once more (i ran into it previously, but somehow forgot), we should get rid of it.the problem is that each sort-of remembers the last element it iterated over.
this has all sorts of nasty side effects, but the following example illustrates the danger of using each and stopping the iteration.
which gives output
The text was updated successfully, but these errors were encountered: