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

Clean-up some unused variables #12187

Merged
merged 5 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12187.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused variables.
12 changes: 4 additions & 8 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
ProfileInfo,
RoomsForUser,
)
from synapse.types import PersistedEventPosition, StateMap, get_domain_from_id
from synapse.types import PersistedEventPosition, get_domain_from_id
from synapse.util.async_helpers import Linearizer
from synapse.util.caches import intern_string
from synapse.util.caches.descriptors import _CacheContext, cached, cachedList
Expand Down Expand Up @@ -273,7 +273,7 @@ def _get_room_summary_txn(txn):
txn.execute(sql, (room_id,))
res = {}
for count, membership in txn:
summary = res.setdefault(membership, MemberSummary([], count))
res.setdefault(membership, MemberSummary([], count))

# we order by membership and then fairly arbitrarily by event_id so
# heroes are consistent
Expand Down Expand Up @@ -839,16 +839,12 @@ async def get_joined_hosts(self, room_id: str, state_entry):

with Measure(self._clock, "get_joined_hosts"):
return await self._get_joined_hosts(
room_id, state_group, state_entry.state, state_entry=state_entry
room_id, state_group, state_entry=state_entry
)

@cached(num_args=2, max_entries=10000, iterable=True)
async def _get_joined_hosts(
self,
room_id: str,
state_group: int,
current_state_ids: StateMap[str],
state_entry: "_StateCacheEntry",
self, room_id: str, state_group: int, state_entry: "_StateCacheEntry"
) -> FrozenSet[str]:
# We don't use `state_group`, its there so that we can cache based on
clokep marked this conversation as resolved.
Show resolved Hide resolved
# it. However, its important that its never None, since two
Expand Down