soft_deactivation: Clarify loop logic around stream_messages.

Break will do the same thing as continue here, as each iteration will
have the same result, and it's also worth explaining why this isn't
one layer up in the loop setup.
This commit is contained in:
Tim Abbott
2019-05-05 18:13:21 -07:00
parent 99414e2d96
commit a1d2b73790

View File

@@ -32,7 +32,10 @@ def filter_by_subscription_history(user_profile: UserProfile,
for log_entry in stream_subscription_logs:
if len(stream_messages) == 0:
continue
# Because stream_messages gets mutated below, this
# check belongs in this inner loop, not the outer loop.
break
if log_entry.event_type == RealmAuditLog.SUBSCRIPTION_DEACTIVATED:
for stream_message in stream_messages:
if stream_message['id'] <= log_entry.event_last_message_id: