From b28b85adf8e68f75c06bd9006ea51497d067a62f Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Mon, 4 Sep 2023 19:55:34 +0900 Subject: [PATCH] tls: remove redundant code in onConnectSecure() Remove redundant code by moving it to outside of `if/else`. PR-URL: https://github.com/nodejs/node/pull/49457 Reviewed-By: Luigi Pinca Reviewed-By: Matthew Aitken --- lib/_tls_wrap.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 3f3a32fcfcfc23..c2dd958f95106e 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1688,14 +1688,12 @@ function onConnectSecure() { debug('client emit secureConnect. rejectUnauthorized: %s, ' + 'authorizationError: %s', options.rejectUnauthorized, this.authorizationError); - this.secureConnecting = false; - this.emit('secureConnect'); } else { this.authorized = true; debug('client emit secureConnect. authorized:', this.authorized); - this.secureConnecting = false; - this.emit('secureConnect'); } + this.secureConnecting = false; + this.emit('secureConnect'); this[kIsVerified] = true; const session = this[kPendingSession];