mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 05:03:51 +01:00
Use list comprehension instead of filter
This commit is contained in:
parent
d46208c12c
commit
f7e2f981ea
2 changed files with 6 additions and 20 deletions
|
@ -177,17 +177,10 @@ class MessageHandler(BaseHandler):
|
|||
|
||||
return True
|
||||
|
||||
event_and_state = filter(
|
||||
allowed,
|
||||
[
|
||||
(e, event_id_to_state[e.event_id])
|
||||
for e in events
|
||||
]
|
||||
)
|
||||
|
||||
defer.returnValue([
|
||||
ev
|
||||
for ev, _ in event_and_state
|
||||
event
|
||||
for event in events
|
||||
if allowed(event, event_id_to_state[event.event_id])
|
||||
])
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
@ -334,17 +334,10 @@ class SyncHandler(BaseHandler):
|
|||
|
||||
return True
|
||||
|
||||
event_and_state = filter(
|
||||
allowed,
|
||||
[
|
||||
(e, event_id_to_state[e.event_id])
|
||||
for e in events
|
||||
]
|
||||
)
|
||||
|
||||
defer.returnValue([
|
||||
ev
|
||||
for ev, _ in event_and_state
|
||||
event
|
||||
for event in events
|
||||
if allowed(event, event_id_to_state[event.event_id])
|
||||
])
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
Loading…
Reference in a new issue