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

Unified Diff: lib/matcher.js

Issue 30011555: Issue 7303 - Deprecate the use of String.prototype.substr() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase Created Feb. 21, 2019, 2:48 p.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
Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -399,17 +399,17 @@
let candidates = pattern.toLowerCase().match(allKeywordsRegExp);
if (!candidates)
return result;
let resultCount = 0xFFFFFF;
let resultLength = 0;
for (let i = 0, l = candidates.length; i < l; i++)
{
- let candidate = candidates[i].substr(1);
+ let candidate = candidates[i].substring(1);
let simpleFilters = this._simpleFiltersByKeyword.get(candidate);
let complexFilters = this._complexFiltersByKeyword.get(candidate);
let count = (typeof simpleFilters != "undefined" ?
simpleFilters.size : 0) +
(typeof complexFilters != "undefined" ?
complexFilters.size : 0);
if (count < resultCount ||
(count == resultCount && candidate.length > resultLength))

Powered by Google App Engine
This is Rietveld