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

Unified Diff: lib/filterListener.js

Issue 29800557: Issue 6559 - Use Map object for known subscriptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Avoid lookup for disabled subscriptions Created June 6, 2018, 10:57 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/filterStorage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -236,31 +236,31 @@
if (!subscription.disabled)
subscription.filters.forEach(removeFilter);
}
function onSubscriptionDisabled(subscription, newValue)
{
FilterListener.setDirty(1);
- if (subscription.url in FilterStorage.knownSubscriptions)
+ if (FilterStorage.knownSubscriptions.has(subscription.url))
{
if (newValue == false)
addFilters(subscription.filters);
else
subscription.filters.forEach(removeFilter);
}
}
function onSubscriptionUpdated(subscription)
{
FilterListener.setDirty(1);
- if (subscription.url in FilterStorage.knownSubscriptions &&
- !subscription.disabled)
+ if (!subscription.disabled &&
+ FilterStorage.knownSubscriptions.has(subscription.url))
{
subscription.oldFilters.forEach(removeFilter);
addFilters(subscription.filters);
}
}
function onFilterHitCount(filter, newValue)
{
« no previous file with comments | « no previous file | lib/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld