Skip to content

Commit

Permalink
Use frozensets
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 19, 2024
1 parent cc98c95 commit 1cf4305
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ async def get_rooms_for_local_user_where_membership_is(
if not membership_list:
return []

# Convert membership list to frozen set as a) it needs to be hashable,
# and b) we don't care about the order.
membership_list = frozenset(membership_list)

rooms = await self._get_rooms_for_local_user_where_membership_is_inner(
user_id,
membership_list,
Expand Down

0 comments on commit 1cf4305

Please sign in to comment.