Skip to content

Commit

Permalink
fix(url parser): move base definition out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jlord committed Jan 17, 2018
1 parent d496c5e commit c908478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/url_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module.exports = function(url, options, callback) {
}
}

let base = result.auth ? `mongodb://${result.auth}@` : `mongodb://`;
let connectionStrings = addresses.map(function(address, i) {
let base = result.auth ? `mongodb://${result.auth}@` : `mongodb://`;
if (i === 0) return `${base}${address.name}:${address.port}`;
else return `${address.name}:${address.port}`;
});
Expand Down

0 comments on commit c908478

Please sign in to comment.