| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -118,23 +118,28 @@ |
| * @return {Filter} |
| */ |
| Filter.fromText = function(text) |
| { |
| let filter = Filter.knownFilters.get(text); |
| if (filter) |
| return filter; |
| - let match = text.includes("#") ? Filter.contentRegExp.exec(text) : null; |
| - if (match) |
| - filter = ContentFilter.fromText(text, match[1], match[2], match[3]); |
| - else if (text[0] == "!") |
| + if (text[0] == "!") |
|
Jon Sonesen
2018/08/29 15:01:36
Is there any difference performance wise between t
Manish Jethani
2018/08/29 15:50:15
In my tests, which was a while ago, I had found th
|
| + { |
| filter = new CommentFilter(text); |
| + } |
| else |
| - filter = RegExpFilter.fromText(text); |
| + { |
| + let match = text.includes("#") ? Filter.contentRegExp.exec(text) : null; |
| + if (match) |
| + filter = ContentFilter.fromText(text, match[1], match[2], match[3]); |
| + else |
| + filter = RegExpFilter.fromText(text); |
| + } |
| Filter.knownFilters.set(filter.text, filter); |
| return filter; |
| }; |
| /** |
| * Deserializes a filter |
| * |