From 69f26340e9814a37b205b0c31aaa10c3de28617b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 25 Sep 2019 10:49:13 -0400 Subject: [PATCH] tls: simplify setSecureContext() option parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following pattern is redundant, so remove it: if (options.foo !== undefined) this.foo = options.foo; else this.foo = undefined; PR-URL: https://github.com/nodejs/node/pull/29704 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Sam Roberts Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Minwoo Jung Reviewed-By: Tobias Nießen Reviewed-By: Rich Trott --- lib/_tls_wrap.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 63115d59b856ba..d29182d585779b 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -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;