From d0b1be13f980210bb071af9c7fa3fcaeda7a2c7f Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 11 Apr 2017 16:48:33 +0200 Subject: [PATCH] net: remove unnecessary process.nextTick() Call internalConnect() directly when the target is an IP address. No delay is necessary because it defers any callbacks it makes. PR-URL: https://github.com/nodejs/node/pull/12342 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- lib/net.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/net.js b/lib/net.js index 0b8284fbdea1b8..4e76dfac06c7e8 100644 --- a/lib/net.js +++ b/lib/net.js @@ -969,10 +969,7 @@ function lookupAndConnect(self, options) { // If host is an IP, skip performing a lookup var addressType = cares.isIP(host); if (addressType) { - process.nextTick(function() { - if (self.connecting) - internalConnect(self, host, port, addressType, localAddress, localPort); - }); + internalConnect(self, host, port, addressType, localAddress, localPort); return; }