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

Unified Diff: lib/filterClasses.js

Issue 29874561: Noissue - Return value of filter match expression directly (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 4, 2018, 1:44 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
@@ -714,23 +714,20 @@
* @param {string} [docDomain] domain name of the document that loads the URL
* @param {boolean} [thirdParty] should be true if the URL is a third-party
* request
* @param {string} [sitekey] public key provided by the document
* @return {boolean} true in case of a match
*/
matches(location, typeMask, docDomain, thirdParty, sitekey)
{
- if (this.contentType & typeMask &&
- (this.thirdParty == null || this.thirdParty == thirdParty) &&
- this.isActiveOnDomain(docDomain, sitekey) && this.regexp.test(location))
- {
- return true;
- }
- return false;
+ return (this.contentType & typeMask) != 0 &&
Manish Jethani 2018/09/04 13:46:06 The first condition here needs to evaluate to a bo
Jon Sonesen 2018/09/05 14:16:38 Yeah, I see what you did there. Stylistically I pr
+ (this.thirdParty == null || this.thirdParty == thirdParty) &&
+ this.isActiveOnDomain(docDomain, sitekey) &&
+ this.regexp.test(location);
}
});
/**
* Creates a RegExp filter from its text representation
* @param {string} text same as in Filter()
* @return {Filter}
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld