Skip to content

Commit c64632e

Browse files
danbevjasnell
authored andcommitted
lib: remove duplicate require calls in tls.js
This commit removes the duplicate require calls of the _tls_common and _tls_wrap modules. The motivation for this being that even though the modules are cached the additional calls are unnecessary. PR-URL: #20099 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent a6be27a commit c64632e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/tls.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const { Buffer } = require('buffer');
3434
const EventEmitter = require('events');
3535
const DuplexPair = require('internal/streams/duplexpair');
3636
const { canonicalizeIP } = process.binding('cares_wrap');
37+
const _tls_common = require('_tls_common');
38+
const _tls_wrap = require('_tls_wrap');
3739

3840
// Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations
3941
// every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more
@@ -265,12 +267,12 @@ exports.parseCertString = internalUtil.deprecate(
265267
'Please use querystring.parse() instead.',
266268
'DEP0076');
267269

268-
exports.createSecureContext = require('_tls_common').createSecureContext;
269-
exports.SecureContext = require('_tls_common').SecureContext;
270-
exports.TLSSocket = require('_tls_wrap').TLSSocket;
271-
exports.Server = require('_tls_wrap').Server;
272-
exports.createServer = require('_tls_wrap').createServer;
273-
exports.connect = require('_tls_wrap').connect;
270+
exports.createSecureContext = _tls_common.createSecureContext;
271+
exports.SecureContext = _tls_common.SecureContext;
272+
exports.TLSSocket = _tls_wrap.TLSSocket;
273+
exports.Server = _tls_wrap.Server;
274+
exports.createServer = _tls_wrap.createServer;
275+
exports.connect = _tls_wrap.connect;
274276

275277
exports.createSecurePair = internalUtil.deprecate(
276278
function createSecurePair(...args) {

0 commit comments

Comments
 (0)