diff options
author | David Baker <dave@matrix.org> | 2017-10-05 13:27:12 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-10-05 13:27:12 +0100 |
commit | 269af961e9910e254f5abc979f0bd293687414f3 (patch) | |
tree | ac3b63943ed58fcf976b0ec552e14b429ae5360e /synapse | |
parent | Add fastpath optimisation (diff) | |
download | synapse-269af961e9910e254f5abc979f0bd293687414f3.tar.xz |
Make be faster
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/push/bulk_push_rule_evaluator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py index ca3b5af807..df16d5ce9e 100644 --- a/synapse/push/bulk_push_rule_evaluator.py +++ b/synapse/push/bulk_push_rule_evaluator.py @@ -112,11 +112,11 @@ class BulkPushRuleEvaluator(object): @defer.inlineCallbacks def _get_sender_power_level(self, event, context): - pl_event_key = (EventTypes.PowerLevels, "", ) - if pl_event_key in context.prev_state_ids: + pl_event_id = context.prev_state_ids.get((EventTypes.PowerLevels, "",)) + if pl_event_id: # fastpath: if there's a power level event, that's all we need, and # not having a power level event is an extreme edge case - auth_events_ids = [context.prev_state_ids[pl_event_key]] + auth_events_ids = [pl_event_id] else: auth_events_ids = yield self.auth.compute_auth_events( event, context.prev_state_ids, for_verification=False, |