From 3de055f42cacbe5fc7428a8d77147fd79e72ca35 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Sat, 2 Sep 2023 19:44:04 +0900 Subject: [PATCH] tls: remove redundant code in onConnectSecure() Remove redundant code by moving it to outside of `if/else`. --- 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 24b9472da6b2d4..156853dc33a697 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1691,14 +1691,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];