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. Revert changes in hot path. Created Feb. 21, 2019, 6:09 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
« no previous file with comments | « lib/filterClasses.js ('k') | lib/rsa.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « lib/filterClasses.js ('k') | lib/rsa.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld