Index: lib/matcher.js |
=================================================================== |
--- a/lib/matcher.js |
+++ b/lib/matcher.js |
@@ -341,18 +341,19 @@ |
* @param {RegExpFilter} filter |
* @returns {boolean} |
*/ |
isSlowFilter(filter) |
{ |
let matcher = ( |
filter instanceof WhitelistFilter ? this.whitelist : this.blacklist |
); |
- if (matcher.hasFilter(filter)) |
- return !matcher.getKeywordForFilter(filter); |
+ let keyword = matcher.getKeywordForFilter(filter); |
+ if (keyword != null) |
+ return !keyword; |
hub
2018/09/13 15:52:40
Why the `!keyword`. I'd just return the proper boo
Manish Jethani
2018/09/14 05:28:32
Do you mean `keyword != ""`?
hub
2018/09/14 12:20:49
no. just `return true`
Manish Jethani
2018/09/14 13:36:25
Well it should be false if the keyword is an empty
Jon Sonesen
2018/09/17 19:13:18
So, returning !keyword here would return true in t
Manish Jethani
2018/09/17 23:36:35
Sorry, I got it backwards. It should return true i
hub
2018/09/18 12:19:40
I see. Works for me as it is.
|
return !matcher.findKeyword(filter); |
} |
/** |
* Optimized filter matching testing both whitelist and blacklist matchers |
* simultaneously. For parameters see |
{@link Matcher#matchesAny Matcher.matchesAny()}. |
* @see Matcher#matchesAny |