Skip to content

Commit 0c2391b

Browse files
committed
lib: adding perf notes js_stream_socket.js
Leaving var in place of let for performance optimization in short loops in hot paths. Added comments explaining why.
1 parent cc6f99d commit 0c2391b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/internal/js_stream_socket.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class JSStreamSocket extends Socket {
157157
let pending = bufs.length;
158158

159159
this.stream.cork();
160+
// Use `var` over `let` for performance optimization.
160161
for (var i = 0; i < bufs.length; ++i)
161162
this.stream.write(bufs[i], done);
162163
this.stream.uncork();

0 commit comments

Comments
 (0)