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 <luigipinca@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
This commit is contained in:
Deokjin Kim 2023-09-04 19:55:34 +09:00 committed by GitHub
parent 8dfe4248ca
commit c8628ed1cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];