summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-17 11:07:04 +0100
committerErik Johnston <erik@matrix.org>2018-07-17 11:07:04 +0100
commitb2aa05a8d6b1b2fb9e1efcc6fb03f1b49bc1be1d (patch)
tree91bcc61fb57e0b62787486aaba875bfa183f5a44 /synapse/util
parentAdd unit test (diff)
downloadsynapse-b2aa05a8d6b1b2fb9e1efcc6fb03f1b49bc1be1d.tar.xz
Use efficient .intersection
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/caches/stream_change_cache.py5
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: