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 <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ben Noordhuis 2017-04-11 16:48:33 +02:00
parent 117b83c2dd
commit 571882c5a4

View File

@ -991,10 +991,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;
}