Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/matcher.js

Issue 29907586: Issue 6994 - Use shortcut matching for location only filters (Closed)
Patch Set: Created Oct. 12, 2018, 4:56 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -169,20 +169,29 @@
specificOnly)
{
let set = this.filterByKeyword.get(keyword);
if (typeof set == "undefined")
return null;
for (let filter of set)
Manish Jethani 2018/10/13 13:28:45 The idea was to have two loops, one for the locati
Jon Sonesen 2018/10/20 23:07:55 Ack
{
+ if (typeMask == 0)
+ continue;
+
if (specificOnly && filter.isGeneric() &&
!(filter instanceof WhitelistFilter))
continue;
+ if (!sitekey || !docDomain || !thirdParty)
+ {
Manish Jethani 2018/10/13 13:28:45 This seems wrong.
Jon Sonesen 2018/10/20 23:07:55 Yeah, super wrong. My bad
+ if (filter.matches(location))
+ return filter;
+ }
+
if (filter.matches(location, typeMask, docDomain, thirdParty, sitekey))
return filter;
}
return null;
}
/**
* Tests whether the URL matches any of the known filters
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld