Skip to content

Commit 4e8a69f

Browse files
committed
fix(url parser): move base definition out of loop
1 parent 5e9af78 commit 4e8a69f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/url_parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ module.exports = function(url, options, callback) {
4848
}
4949
}
5050

51+
let base = result.auth ? `mongodb://${result.auth}@` : `mongodb://`;
5152
let connectionStrings = addresses.map(function(address, i) {
52-
let base = result.auth ? `mongodb://${result.auth}@` : `mongodb://`;
5353
if (i === 0) return `${base}${address.name}:${address.port}`;
5454
else return `${address.name}:${address.port}`;
5555
});

0 commit comments

Comments
 (0)