From 06d16cf9ef55a601d500734bfe17595a652c9637 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 8a6c7456babbd0..df593a5255af87 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -63,11 +63,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])); }