Skip to content

Commit d0b1be1

Browse files
bnoordhuisevanlucas
authored andcommitted
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 dcc9e1a commit d0b1be1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/net.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -969,10 +969,7 @@ function lookupAndConnect(self, options) {
969969
// If host is an IP, skip performing a lookup
970970
var addressType = cares.isIP(host);
971971
if (addressType) {
972-
process.nextTick(function() {
973-
if (self.connecting)
974-
internalConnect(self, host, port, addressType, localAddress, localPort);
975-
});
972+
internalConnect(self, host, port, addressType, localAddress, localPort);
976973
return;
977974
}
978975

0 commit comments

Comments
 (0)