Skip to content

Commit

Permalink
net: remove unnecessary process.nextTick()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bnoordhuis authored and evanlucas committed May 2, 2017
1 parent dcc9e1a commit d0b1be1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d0b1be1

Please sign in to comment.