Use list comprehension instead of filter
This commit is contained in:
parent
d46208c12c
commit
f7e2f981ea
|
@ -177,17 +177,10 @@ class MessageHandler(BaseHandler):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
event_and_state = filter(
|
|
||||||
allowed,
|
|
||||||
[
|
|
||||||
(e, event_id_to_state[e.event_id])
|
|
||||||
for e in events
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
defer.returnValue([
|
defer.returnValue([
|
||||||
ev
|
event
|
||||||
for ev, _ in event_and_state
|
for event in events
|
||||||
|
if allowed(event, event_id_to_state[event.event_id])
|
||||||
])
|
])
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
|
@ -334,17 +334,10 @@ class SyncHandler(BaseHandler):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
event_and_state = filter(
|
|
||||||
allowed,
|
|
||||||
[
|
|
||||||
(e, event_id_to_state[e.event_id])
|
|
||||||
for e in events
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
defer.returnValue([
|
defer.returnValue([
|
||||||
ev
|
event
|
||||||
for ev, _ in event_and_state
|
for event in events
|
||||||
|
if allowed(event, event_id_to_state[event.event_id])
|
||||||
])
|
])
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
|
Loading…
Reference in New Issue