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
This commit is contained in:
Eric Eastwood 2021-11-09 14:14:37 -06:00
parent d10625eb18
commit 2370dcadf6

View file

@ -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).