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

Unified Diff: lib/filterComposer.js

Issue 29522601: Noissue - Use includes instead of indexOf (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Aug. 21, 2017, 11:16 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 | « lib/devtools.js ('k') | lib/notificationHelper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterComposer.js
===================================================================
--- a/lib/filterComposer.js
+++ b/lib/filterComposer.js
@@ -113,17 +113,17 @@
if (!filter)
{
let filterText = url.replace(/^[\w-]+:\/+(?:www\.)?/, "||");
if (specificOnly)
filterText += "$domain=" + docDomain;
- if (filters.indexOf(filterText) == -1)
+ if (!filters.includes(filterText))
filters.push(filterText);
}
}
// If we couldn't generate any blocking filters, fallback to element hiding
if (filters.length == 0 && !checkWhitelisted(page, frame,
RegExpFilter.typeMap.ELEMHIDE))
{
« no previous file with comments | « lib/devtools.js ('k') | lib/notificationHelper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld