-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tls: refactor variable declarations #22219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
var out = Object.create(null); | ||
var parts = s.split('\n'); | ||
const out = Object.create(null); | ||
const parts = s.split('\n'); | ||
for (var i = 0, len = parts.length; i < len; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we replace the for loop by a for-of loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the traditional for loop is still significantly faster than for-of and is fairly idiomatic still within Node.js core js.
PR-URL: #22219 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Landed in 74d3363 |
PR-URL: #22219 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Jon Moss <[email protected]>
change var to const
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes