Skip to content

Commit 571882c

Browse files
committed
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: #12342 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 117b83c commit 571882c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/net.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,7 @@ function lookupAndConnect(self, options) {
991991
// If host is an IP, skip performing a lookup
992992
var addressType = cares.isIP(host);
993993
if (addressType) {
994-
process.nextTick(function() {
995-
if (self.connecting)
996-
internalConnect(self, host, port, addressType, localAddress, localPort);
997-
});
994+
internalConnect(self, host, port, addressType, localAddress, localPort);
998995
return;
999996
}
1000997

0 commit comments

Comments
 (0)