summary refs log tree commit diff
path: root/synapse/storage/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-23 17:53:49 +0000
committerErik Johnston <erik@matrix.org>2017-03-23 17:53:49 +0000
commit00957d1aa4b01a199ab2c3abf30032a0ca0b1e12 (patch)
tree79f6e968f784c6d4e05cda9c298d5a32fbc88291 /synapse/storage/room.py
parentMerge pull request #2005 from kfatehi/docs/readme (diff)
downloadsynapse-00957d1aa4b01a199ab2c3abf30032a0ca0b1e12.tar.xz
User Cursor.__iter__ instead of fetchall
This prevents unnecessary construction of lists
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r--synapse/storage/room.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 8a2fe2fdf5..e4c56cc175 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -396,7 +396,7 @@ class RoomStore(SQLBaseStore):
                     sql % ("AND appservice_id IS NULL",),
                     (stream_id,)
                 )
-            return dict(txn.fetchall())
+            return dict(txn)
         else:
             # We want to get from all lists, so we need to aggregate the results
 
@@ -422,7 +422,7 @@ class RoomStore(SQLBaseStore):
 
             results = {}
             # A room is visible if its visible on any list.
-            for room_id, visibility in txn.fetchall():
+            for room_id, visibility in txn:
                 results[room_id] = bool(visibility) or results.get(room_id, False)
 
             return results