minor: Move code and add comments about three lists.

This commit is contained in:
Steve Howell
2020-10-18 16:11:25 +00:00
committed by Tim Abbott
parent ffee129a35
commit 628a826aa2

View File

@@ -5011,10 +5011,6 @@ def gather_subscriptions_helper(user_profile: UserProfile,
stream_ids = {sub["stream_id"] for sub in sub_dicts}
recent_traffic = get_streams_traffic(stream_ids=stream_ids)
subscribed = []
unsubscribed = []
never_subscribed = []
# The highly optimized bulk_get_subscriber_user_ids wants to know which
# streams we are subscribed to, for validation purposes, and it uses that
# info to know if it's allowed to find OTHER subscribers.
@@ -5031,6 +5027,12 @@ def gather_subscriptions_helper(user_profile: UserProfile,
# which the below code needs to check for anyway.
subscriber_map = defaultdict(lambda: None)
# Okay, now we finally get to populating our main results, which
# will be these three lists.
subscribed = []
unsubscribed = []
never_subscribed = []
sub_unsub_stream_ids = set()
for sub in sub_dicts:
stream_id = sub["stream_id"]