mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
User Cursor.__iter__ instead of fetchall
This prevents unnecessary construction of lists
This commit is contained in:
parent
59358cd3e7
commit
00957d1aa4
16 changed files with 41 additions and 42 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue