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

Unified Diff: lib/filterStorage.js

Issue 29550598: Issue 5735 - Use JS Map instead of Object for Filter.knownFilters (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: address comments Created Sept. 20, 2017, 9:21 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
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
diff --git a/lib/filterStorage.js b/lib/filterStorage.js
index 9c901155748a06eae779cf6f6fe3115e20ca9ced..ca0ecbcbd0637ef2ace968ffdf51101f8a2824db 100644
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -337,11 +337,7 @@ let FilterStorage = exports.FilterStorage =
resetHitCounts(filters)
{
if (!filters)
- {
- filters = [];
- for (let text in Filter.knownFilters)
- filters.push(Filter.knownFilters[text]);
- }
+ filters = Filter.knownFilters.values();
for (let filter of filters)
{
filter.hitCount = 0;
@@ -695,7 +691,7 @@ function INIParser()
{
this.fileProperties = this.curObj = {};
this.subscriptions = [];
- this.knownFilters = Object.create(null);
+ this.knownFilters = new Map();
this.knownSubscriptions = Object.create(null);
}
INIParser.prototype =
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld