From e0e73f6850dc37540d341f5d2a9cde3739417d85 Mon Sep 17 00:00:00 2001 From: rickyes Date: Sun, 5 Apr 2020 16:57:13 +0800 Subject: [PATCH] dns: remove duplicate code PR-URL: https://github.com/nodejs/node/pull/32664 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- lib/dns.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/dns.js b/lib/dns.js index bd330ba92bc1d6..4243a05e179b88 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -65,11 +65,7 @@ function onlookup(err, addresses) { if (err) { return this.callback(dnsException(err, 'getaddrinfo', this.hostname)); } - if (this.family) { - this.callback(null, addresses[0], this.family); - } else { - this.callback(null, addresses[0], isIP(addresses[0])); - } + this.callback(null, addresses[0], this.family || isIP(addresses[0])); }