Skip to content

Commit 69f2634

Browse files
cjihrigtargos
authored andcommitted
tls: simplify setSecureContext() option parsing
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>
1 parent 0041f1c commit 69f2634

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/_tls_wrap.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1114,20 +1114,14 @@ Server.prototype.setSecureContext = function(options) {
11141114
else
11151115
this.crl = undefined;
11161116

1117-
if (options.sigalgs !== undefined)
1118-
this.sigalgs = options.sigalgs;
1119-
else
1120-
this.sigalgs = undefined;
1117+
this.sigalgs = options.sigalgs;
11211118

11221119
if (options.ciphers)
11231120
this.ciphers = options.ciphers;
11241121
else
11251122
this.ciphers = undefined;
11261123

1127-
if (options.ecdhCurve !== undefined)
1128-
this.ecdhCurve = options.ecdhCurve;
1129-
else
1130-
this.ecdhCurve = undefined;
1124+
this.ecdhCurve = options.ecdhCurve;
11311125

11321126
if (options.dhparam)
11331127
this.dhparam = options.dhparam;

0 commit comments

Comments
 (0)