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 <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
gengjiawen authored and danbev committed Mar 15, 2019
1 parent cd8b739 commit 2788fd6
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 2788fd6

Please sign in to comment.