Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit fc51b36

Browse files
fix lint
1 parent 890d63e commit fc51b36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

synapse/storage/databases/main/roommember.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,19 +678,19 @@ async def get_users_who_share_room_with_user(
678678
)
679679
async def get_mutual_rooms_between_users(
680680
self, user_ids: FrozenSet[str], cache_context: _CacheContext
681-
) -> Set[str]:
681+
) -> FrozenSet[str]:
682682
"""Returns the set of rooms that all users in user_ids share"""
683-
shared_room_ids = None
683+
shared_room_ids: Optional[FrozenSet[str]] = None
684684
for user_id in user_ids:
685685
room_ids = await self.get_rooms_for_user(
686686
user_id, on_invalidate=cache_context.invalidate
687687
)
688-
if shared_room_ids is None:
689-
shared_room_ids = room_ids
690-
else:
688+
if shared_room_ids is not None:
691689
shared_room_ids &= room_ids
690+
else:
691+
shared_room_ids = room_ids
692692

693-
return shared_room_ids or set()
693+
return shared_room_ids or frozenset()
694694

695695
async def get_joined_users_from_context(
696696
self, event: EventBase, context: EventContext

0 commit comments

Comments
 (0)