util: refactor filterDuplicateStrings for readability#60347
util: refactor filterDuplicateStrings for readability#60347Ayoub-Mabrouk wants to merge 1 commit intonodejs:mainfrom
Conversation
Modernize filterDuplicateStrings by using for-of loop and ternary operator for cleaner, more idiomatic ES2018 code. Changes: - Replace traditional for loop with for-of iteration - Consolidate conditional map.set() using ternary operator - Eliminate iterator variable reducing cognitive complexity No functional changes, performance remains equivalent.
|
Hi @Ayoub-Mabrouk as I know, the Node.js team is trying to avoid the |
Thanks alot 🙏👌 |
|
for-of is much slower than a for loop. |
Thanks for the feedback |
|
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
|
Closing this because it has stalled. Feel free to reopen if this issue/PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
Modernize filterDuplicateStrings by using for-of loop and ternary
operator for cleaner, more idiomatic ES2018 code.
Changes:
No functional changes, performance remains equivalent.