From 2370dcadf67bd4a0785c37479f9b33b6a03696c6 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 9 Nov 2021 14:14:37 -0600 Subject: [PATCH] Remove redundant length check > if `len(auth_event_ids) == 0` then `auth_event_ids` will be falsey, so the extra check is redundant. > > -- https://github.com/matrix-org/synapse/pull/11243#discussion_r745408186 --- synapse/handlers/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 30b7bfca3c..8683c98790 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -961,7 +961,7 @@ class EventCreationHandler: or len(prev_event_ids) > 0 # Allow an event to have empty list of prev_event_ids # only if it has auth_event_ids. - or (auth_event_ids and len(auth_event_ids) > 0) + or auth_event_ids ), "Attempting to create a non-m.room.create event with no prev_events or auth_event_ids" else: # we now ought to have some prev_events (unless it's a create event).