Skip to content
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

cluster: replace forEach with for..of in lib/internal/cluster/ directory #50317

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jerome-benoit
Copy link

No description provided.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
@nodejs-github-bot nodejs-github-bot added cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. labels Oct 21, 2023
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
@MrHBS
Copy link

MrHBS commented Oct 22, 2023

Out of curiosity why this change?

@jerome-benoit
Copy link
Author

jerome-benoit commented Oct 22, 2023

Out of curiosity why this change?

Coding style consistency.
There might also have performance implications at using implicitly iterator on collections (no boundary check, less memory footprint, ...), especially on large collection. forEach is probably using already iterator under the hood, with for...of it's explicit and does not depend on an helper implementation.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants