http: use arrow fns for lexical this in Agent#16475
http: use arrow fns for lexical this in Agent#16475bengl wants to merge 1 commit intonodejs:masterfrom
this in Agent#16475Conversation
| this.maxSockets = this.options.maxSockets || Agent.defaultMaxSockets; | ||
| this.maxFreeSockets = this.options.maxFreeSockets || 256; | ||
|
|
||
| this.on('free', (socket, options) => { |
There was a problem hiding this comment.
FWIW this function can be pulled out, named, and referenced here instead IIRC.
There was a problem hiding this comment.
Is there an advantage to pulling it out here?
benjamingr
left a comment
There was a problem hiding this comment.
LGTM, looks like there is no public API impact either.
Did you run any benchmarks on this btw?
|
@benjamingr Here's On master: With this patch: |
|
@bengl - There are other instances of |
|
@gireeshpunathil I hadn't thought of it that way, but yes, this sort of change could be good for code-and-learn. |
|
Landed in 1f045f4 |
PR-URL: #16475 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#16475 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #16475 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
http