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

Unified Diff: lib/filterClasses.js

Issue 29801558: Issue 6737 - Use String.includes instead of String.indexOf (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Replace more instances Created June 7, 2018, 9:51 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/downloader.js ('k') | 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
@@ -736,17 +736,17 @@
let matchCase = null;
let domains = null;
let sitekeys = null;
let thirdParty = null;
let collapse = null;
let csp = null;
let rewrite = null;
let options;
- let match = (text.indexOf("$") >= 0 ? Filter.optionsRegExp.exec(text) : null);
+ let match = text.includes("$") ? Filter.optionsRegExp.exec(text) : null;
if (match)
{
options = match[1].split(",");
text = match.input.substr(0, match.index);
for (let option of options)
{
let value = null;
let separatorIndex = option.indexOf("=");
« no previous file with comments | « lib/downloader.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld