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

Unified Diff: lib/coreUtils.js

Issue 29780560: Issue 6665 - Optimize element hiding emulation filter lookups (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Roll back generics overkill Created May 14, 2018, 1:18 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/elemHideEmulation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/coreUtils.js
===================================================================
--- a/lib/coreUtils.js
+++ b/lib/coreUtils.js
@@ -50,8 +50,16 @@
}
exports.findIndex = findIndex;
function indexOf(iterable, searchElement)
{
return findIndex(iterable, item => item === searchElement);
}
exports.indexOf = indexOf;
+
+function* regExpIt(regExp, string)
+{
+ let match = null;
+ while (match = regExp.exec(string))
+ yield match;
+}
+exports.regExpIt = regExpIt;
« no previous file with comments | « no previous file | lib/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld