Skip to content

Commit

Permalink
http: delay ret declaration in method _flushOutput
Browse files Browse the repository at this point in the history
PR-URL: #26562
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
gengjiawen authored and targos committed Mar 27, 2019
1 parent 24e96b2 commit c96946d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,13 @@ OutgoingMessage.prototype._flush = function _flush() {
};

OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
var ret;
var outputLength = this.outputData.length;
const outputLength = this.outputData.length;
if (outputLength <= 0)
return ret;
return undefined;

var outputData = this.outputData;
const outputData = this.outputData;
socket.cork();
let ret;
for (var i = 0; i < outputLength; i++) {
const { data, encoding, callback } = outputData[i];
ret = socket.write(data, encoding, callback);
Expand Down

0 comments on commit c96946d

Please sign in to comment.