http: use direct parameters instead
When parameter count is fixed, use literal Array instance is more simply and avoid arguments leak also. PR-URL: https://github.com/nodejs/node/pull/10833 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
This commit is contained in:
parent
90c2ac7be3
commit
aa8eb8747c
@ -718,21 +718,15 @@ ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) {
|
|||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
ClientRequest.prototype.setNoDelay = function setNoDelay() {
|
ClientRequest.prototype.setNoDelay = function setNoDelay(noDelay) {
|
||||||
const argsLen = arguments.length;
|
this._deferToConnect('setNoDelay', [noDelay]);
|
||||||
const args = new Array(argsLen);
|
|
||||||
for (var i = 0; i < argsLen; i++)
|
|
||||||
args[i] = arguments[i];
|
|
||||||
this._deferToConnect('setNoDelay', args);
|
|
||||||
};
|
|
||||||
ClientRequest.prototype.setSocketKeepAlive = function setSocketKeepAlive() {
|
|
||||||
const argsLen = arguments.length;
|
|
||||||
const args = new Array(argsLen);
|
|
||||||
for (var i = 0; i < argsLen; i++)
|
|
||||||
args[i] = arguments[i];
|
|
||||||
this._deferToConnect('setKeepAlive', args);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ClientRequest.prototype.setSocketKeepAlive =
|
||||||
|
function setSocketKeepAlive(enable, initialDelay) {
|
||||||
|
this._deferToConnect('setKeepAlive', [enable, initialDelay]);
|
||||||
|
};
|
||||||
|
|
||||||
ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
|
ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
|
||||||
this.setTimeout(0, cb);
|
this.setTimeout(0, cb);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user