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

Unified Diff: lib/filterClasses.js

Issue 6603225352372224: Issue 2177 - Optimize filter matching performance by performing regexp match last (Closed)
Patch Set: Created March 19, 2015, 5:46 p.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/filterClasses.js
===================================================================
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -618,10 +618,9 @@
*/
matches: function(location, contentType, docDomain, thirdParty, sitekey)
{
- if (this.regexp.test(location) &&
- (RegExpFilter.typeMap[contentType] & this.contentType) != 0 &&
+ if ((RegExpFilter.typeMap[contentType] & this.contentType) != 0 &&
(this.thirdParty == null || this.thirdParty == thirdParty) &&
- this.isActiveOnDomain(docDomain, sitekey))
+ this.isActiveOnDomain(docDomain, sitekey) && this.regexp.test(location))
{
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld