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: Created Sept. 20, 2017, 8:20 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..ce9a4f9e09e2f0f696f5edb98d2353b6a742dd1a 100644
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -338,9 +338,7 @@ let FilterStorage = exports.FilterStorage =
{
if (!filters)
{
Wladimir Palant 2017/09/20 08:59:10 Nit: You can remove the brackets around this block
sergei 2017/09/20 09:22:40 Done.
- filters = [];
- for (let text in Filter.knownFilters)
- filters.push(Filter.knownFilters[text]);
+ filters = Filter.knownFilters.values();
}
for (let filter of filters)
{
@@ -695,7 +693,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