Skip to content

Commit

Permalink
tls: simplify setSecureContext() option parsing
Browse files Browse the repository at this point in the history
The following pattern is redundant, so remove it:

if (options.foo !== undefined)
  this.foo = options.foo;
else
  this.foo = undefined;

PR-URL: #29704
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Oct 1, 2019
1 parent 0041f1c commit 69f2634
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,20 +1114,14 @@ Server.prototype.setSecureContext = function(options) {
else
this.crl = undefined;

if (options.sigalgs !== undefined)
this.sigalgs = options.sigalgs;
else
this.sigalgs = undefined;
this.sigalgs = options.sigalgs;

if (options.ciphers)
this.ciphers = options.ciphers;
else
this.ciphers = undefined;

if (options.ecdhCurve !== undefined)
this.ecdhCurve = options.ecdhCurve;
else
this.ecdhCurve = undefined;
this.ecdhCurve = options.ecdhCurve;

if (options.dhparam)
this.dhparam = options.dhparam;
Expand Down

0 comments on commit 69f2634

Please sign in to comment.