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

Unified Diff: lib/common.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 | « no previous file | lib/downloader.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/common.js
===================================================================
--- a/lib/common.js
+++ b/lib/common.js
@@ -59,17 +59,17 @@
// remove trailing wildcards
.replace(/(\.\*)$/, "");
}
exports.filterToRegExp = filterToRegExp;
function splitSelector(selector)
{
- if (selector.indexOf(",") == -1)
+ if (!selector.includes(","))
return [selector];
let selectors = [];
let start = 0;
let level = 0;
let sep = "";
for (let i = 0; i < selector.length; i++)
« no previous file with comments | « no previous file | lib/downloader.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld