Skip to content

Commit

Permalink
http: refactor to remove redundant argument of _deferToConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed May 8, 2021
1 parent 52e4fb5 commit 0e4595b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ function onSocketNT(req, socket, err) {
}
}

ClientRequest.prototype._deferToConnect = _deferToConnect;
function _deferToConnect(method, arguments_, cb) {
ClientRequest.prototype._deferToConnect =
function _deferToConnect(method, arguments_) {
// This function is for calls that need to happen once the socket is
// assigned to this request and writable. It's an important promisy
// thing for all the socket calls that happen either now
Expand All @@ -828,9 +828,6 @@ function _deferToConnect(method, arguments_, cb) {
const callSocketMethod = () => {
if (method)
ReflectApply(this.socket[method], this.socket, arguments_);

if (typeof cb === 'function')
cb();
};

const onSocket = () => {
Expand All @@ -846,7 +843,7 @@ function _deferToConnect(method, arguments_, cb) {
} else {
onSocket();
}
}
};

ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) {
if (this._ended) {
Expand Down

0 comments on commit 0e4595b

Please sign in to comment.