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

Issue 30000574: Noissue - Remove unnecessary checks for specific-only matches (Closed)

Created:
Feb. 6, 2019, 11:12 a.m. by Manish Jethani
Modified:
Feb. 6, 2019, 6:13 p.m.
Reviewers:
Sebastian Noack, hub
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

For specific-only lookups, there's no need to check if the filter is a whitelist filter. CombinedMatcher already should make sure that the specific-only flag is not passed for whitelist filters. The Matcher class should not be used directly.

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -9 lines) Patch
M lib/matcher.js View 3 chunks +4 lines, -9 lines 5 comments Download

Messages

Total messages: 6
Manish Jethani
Feb. 6, 2019, 11:13 a.m. (2019-02-06 11:13:22 UTC) #1
Manish Jethani
Patch Set 1 Looking for a quick review. https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js File lib/matcher.js (left): https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js#oldcode361 lib/matcher.js:361: !(filter ...
Feb. 6, 2019, 11:18 a.m. (2019-02-06 11:18:20 UTC) #2
hub
https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js File lib/matcher.js (left): https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js#oldcode361 lib/matcher.js:361: !(filter instanceof WhitelistFilter)) On 2019/02/06 11:18:20, Manish Jethani wrote: ...
Feb. 6, 2019, 3:46 p.m. (2019-02-06 15:46:45 UTC) #3
Sebastian Noack
LGTM
Feb. 6, 2019, 3:57 p.m. (2019-02-06 15:57:54 UTC) #4
Manish Jethani
https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js File lib/matcher.js (left): https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js#oldcode361 lib/matcher.js:361: !(filter instanceof WhitelistFilter)) On 2019/02/06 15:46:44, hub wrote: > ...
Feb. 6, 2019, 4:16 p.m. (2019-02-06 16:16:01 UTC) #5
hub
Feb. 6, 2019, 5:47 p.m. (2019-02-06 17:47:56 UTC) #6
LGTM

https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js
File lib/matcher.js (left):

https://codereview.adblockplus.org/30000574/diff/30000575/lib/matcher.js#oldc...
lib/matcher.js:361: !(filter instanceof WhitelistFilter))
On 2019/02/06 16:16:00, Manish Jethani wrote:
> On 2019/02/06 15:46:44, hub wrote:
> > On 2019/02/06 11:18:20, Manish Jethani wrote:
> > > It's up to the caller to not pass the specific-only flag for whitelist
> > filters.
> > 
> > I tend to think we should protect ourselves from the caller.
> 
> Yeah, but my point was that we should not expose the Matcher class directly.
If
> the caller wants the correct ad blocking behavior, they should use
> CombinedMatcher. If they want "raw" filter matching, then they can use Matcher
> but then it's just a dumb object and follows a fixed script. The nuance is in
> CombinedMatcher.

Fair enough.

Powered by Google App Engine
This is Rietveld