Skip to content

Commit 61e1af2

Browse files
thefourtheyeaddaleax
authored andcommitted
lib: remove unnecessary assignments with _extend
The first parameter to `util._extend` is the target object. Assigning the target object to the result of `util._extend` is not necessary. PR-URL: #11364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Brian White <[email protected]>
1 parent e1573b9 commit 61e1af2

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/_http_agent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Agent.prototype.addRequest = function addRequest(req, options) {
121121
}
122122

123123
options = util._extend({}, options);
124-
options = util._extend(options, this.options);
124+
util._extend(options, this.options);
125125

126126
if (!options.servername) {
127127
options.servername = options.host;
@@ -176,7 +176,7 @@ Agent.prototype.addRequest = function addRequest(req, options) {
176176
Agent.prototype.createSocket = function createSocket(req, options, cb) {
177177
var self = this;
178178
options = util._extend({}, options);
179-
options = util._extend(options, self.options);
179+
util._extend(options, self.options);
180180

181181
if (!options.servername) {
182182
options.servername = options.host;

lib/_tls_wrap.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,9 @@ function normalizeConnectArgs(listArgs) {
978978
// the host/port/path args that it knows about, not the tls options.
979979
// This means that options.host overrides a host arg.
980980
if (listArgs[1] !== null && typeof listArgs[1] === 'object') {
981-
options = util._extend(options, listArgs[1]);
981+
util._extend(options, listArgs[1]);
982982
} else if (listArgs[2] !== null && typeof listArgs[2] === 'object') {
983-
options = util._extend(options, listArgs[2]);
983+
util._extend(options, listArgs[2]);
984984
}
985985

986986
return (cb) ? [options, cb] : [options];

lib/child_process.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ exports.execFile = function(file /*, args, options, callback*/) {
133133
}
134134

135135
if (pos < arguments.length && typeof arguments[pos] === 'object') {
136-
options = util._extend(options, arguments[pos++]);
136+
util._extend(options, arguments[pos++]);
137137
} else if (pos < arguments.length && arguments[pos] == null) {
138138
pos++;
139139
}

lib/internal/cluster/master.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ cluster.setupMaster = function(options) {
4848
execArgv: process.execArgv,
4949
silent: false
5050
};
51-
settings = util._extend(settings, cluster.settings);
52-
settings = util._extend(settings, options || {});
51+
util._extend(settings, cluster.settings);
52+
util._extend(settings, options || {});
5353

5454
// Tell V8 to write profile data for each process to a separate file.
5555
// Without --logfile=v8-%p.log, everything ends up in a single, unusable
@@ -110,7 +110,7 @@ function createWorkerProcess(id, env) {
110110
var execArgv = cluster.settings.execArgv.slice();
111111
var debugPort = 0;
112112

113-
workerEnv = util._extend(workerEnv, env);
113+
util._extend(workerEnv, env);
114114
workerEnv.NODE_UNIQUE_ID = '' + id;
115115

116116
for (var i = 0; i < execArgv.length; i++) {

0 commit comments

Comments
 (0)