We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 946f3e1 + f083a22 commit 79eb585Copy full SHA for 79eb585
lib/portfinder.js
@@ -142,19 +142,9 @@ exports.getPort = function (options, callback) {
142
}
143
144
if (options.host) {
145
-
146
- var hasUserGivenHost;
147
- for (var i = 0; i < exports._defaultHosts.length; i++) {
148
- if (exports._defaultHosts[i] === options.host) {
149
- hasUserGivenHost = true;
150
- break;
151
- }
+ if (exports._defaultHosts.indexOf(options.host) !== -1) {
+ exports._defaultHosts.push(options.host)
152
153
154
- if (!hasUserGivenHost) {
155
- exports._defaultHosts.push(options.host);
156
157
158
159
160
var openPorts = [], currentHost;
0 commit comments