Skip to content

Commit

Permalink
tls: remove redundant code in onConnectSecure()
Browse files Browse the repository at this point in the history
Remove redundant code by moving it to outside of `if/else`.

PR-URL: #49457
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
  • Loading branch information
deokjinkim authored and UlisesGascon committed Sep 10, 2023
1 parent 9a0891f commit b28b85a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit b28b85a

Please sign in to comment.