mirror of https://github.com/zulip/zulip.git
apply_event: Replace list comprehension with list.remove.
This should be about 4 times faster, saving something like half a millisecond on each stream of 10000 subscribers. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
bbafced254
commit
8f281c4fc9
|
@ -647,7 +647,7 @@ def apply_event(state: Dict[str, Any],
|
||||||
# Remove our user from the subscribers of the removed subscriptions.
|
# Remove our user from the subscribers of the removed subscriptions.
|
||||||
if include_subscribers:
|
if include_subscribers:
|
||||||
for sub in removed_subs:
|
for sub in removed_subs:
|
||||||
sub['subscribers'] = [id for id in sub['subscribers'] if id != user_profile.id]
|
sub['subscribers'].remove(user_profile.id)
|
||||||
|
|
||||||
# We must effectively copy the removed subscriptions from subscriptions to
|
# We must effectively copy the removed subscriptions from subscriptions to
|
||||||
# unsubscribe, since we only have the name in our data structure.
|
# unsubscribe, since we only have the name in our data structure.
|
||||||
|
|
Loading…
Reference in New Issue