Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Removed try-catch to enable optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Feb 27, 2016
1 parent 5536cdf commit 40e67a2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/persistence/mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,7 @@ MongoPersistence.prototype.storeRetained = function(packet, cb) {
};

MongoPersistence.prototype.lookupRetained = function(pattern, cb) {
var regexp;
try {
regexp = new RegExp(pattern.replace(/(#|\+)/, ".+"));
} catch (e) {
cb(e, []);
return;
}
var regexp = new RegExp(pattern.replace(/(#|\+)/, ".+").replace('\\', '\\\\'));
var stream = this._retained.find({ topic: { $regex: regexp } }).stream();
var matched = [];
var matcher = new Matcher();
Expand Down

0 comments on commit 40e67a2

Please sign in to comment.