diff options
author | Erik Johnston <erik@matrix.org> | 2018-07-17 11:07:04 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-07-17 11:07:04 +0100 |
commit | b2aa05a8d6b1b2fb9e1efcc6fb03f1b49bc1be1d (patch) | |
tree | 91bcc61fb57e0b62787486aaba875bfa183f5a44 | |
parent | Add unit test (diff) | |
download | synapse-b2aa05a8d6b1b2fb9e1efcc6fb03f1b49bc1be1d.tar.xz |
Use efficient .intersection
-rw-r--r-- | synapse/util/caches/stream_change_cache.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/synapse/util/caches/stream_change_cache.py b/synapse/util/caches/stream_change_cache.py index c1e76b1a0e..f2bde74dc5 100644 --- a/synapse/util/caches/stream_change_cache.py +++ b/synapse/util/caches/stream_change_cache.py @@ -80,10 +80,7 @@ class StreamChangeCache(object): ) } - result = { - e for e in entities - if e in changed_entities - } + result = changed_entities.intersection(entities) self.metrics.inc_hits() else: |