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: Move check for known subscription into removeSubscription Created June 6, 2018, 11 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') | lib/filterStorage.js » ('J')
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 &&
Manish Jethani 2018/06/06 11:04:42 Better to check if the subscription is disabled fi
kzar 2018/06/07 13:52:26 Acknowledged.
+ 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') | lib/filterStorage.js » ('J')

Powered by Google App Engine
This is Rietveld