Index: lib/filterStorage.js |
=================================================================== |
--- a/lib/filterStorage.js |
+++ b/lib/filterStorage.js |
@@ -123,16 +123,31 @@ |
* @type {number} |
*/ |
get subscriptionCount() |
{ |
return this.knownSubscriptions.size; |
} |
/** |
+ * Adds any subscriptions to which a filter belongs to the filter. |
+ * @param {Filter} filter |
+ */ |
+ addSubscriptionsToFilter(filter) |
+ { |
+ for (let subscription of this.subscriptions()) |
+ { |
+ if (subscription.filters.indexOf(filter) != -1) |
hub
2018/11/10 04:33:21
this is quite an expensive search, isn't it?
Manish Jethani
2018/11/15 22:58:52
Yes, so here's the thing:
1. This function will
hub
2018/11/16 17:04:39
So shall we make sure the review 29934588 lands fi
Manish Jethani
2018/11/17 19:49:17
OK, let's do this one first instead, it's easier:
|
+ filter.addSubscription(subscription); |
+ } |
+ |
+ filter.subscriptionsAssigned = true; |
+ } |
+ |
+ /** |
* Finds the filter group that a filter should be added to by default. Will |
* return <code>null</code> if this group doesn't exist yet. |
* @param {Filter} filter |
* @returns {?SpecialSubscription} |
*/ |
getGroupForFilter(filter) |
{ |
let generalSubscription = null; |