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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 29841555: Issue 6814 - Avoid redundant calls to domains getter (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created July 29, 2018, 12:18 p.m.
Right Patch Set: Fetch sitekeys as well Created July 29, 2018, 3:26 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 return true; 538 return true;
539 }, 539 },
540 540
541 /** 541 /**
542 * Checks whether this filter is generic or specific 542 * Checks whether this filter is generic or specific
543 * @return {boolean} 543 * @return {boolean}
544 */ 544 */
545 isGeneric() 545 isGeneric()
546 { 546 {
547 let {domains} = this; 547 let {sitekeys, domains} = this;
Manish Jethani 2018/07/29 15:27:51 It didn't feel right to leave sitekeys behind here
548 548
549 return !(this.sitekeys && this.sitekeys.length) && 549 return !(sitekeys && sitekeys.length) && (!domains || domains.get(""));
550 (!domains || domains.get(""));
551 }, 550 },
552 551
553 /** 552 /**
554 * See Filter.serialize() 553 * See Filter.serialize()
555 * @inheritdoc 554 * @inheritdoc
556 */ 555 */
557 serialize(buffer) 556 serialize(buffer)
558 { 557 {
559 if (this._disabled || this._hitCount || this._lastHit) 558 if (this._disabled || this._hitCount || this._lastHit)
560 { 559 {
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 1172
1174 /** 1173 /**
1175 * Script that should be executed 1174 * Script that should be executed
1176 * @type {string} 1175 * @type {string}
1177 */ 1176 */
1178 get script() 1177 get script()
1179 { 1178 {
1180 return this.body; 1179 return this.body;
1181 } 1180 }
1182 }); 1181 });
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld