Remove some unused variables/parameters. (#12187)

This commit is contained in:
Patrick Cloke 2022-03-09 10:29:39 -05:00 committed by GitHub
parent 180d8ff0d4
commit 032688854b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

1
changelog.d/12187.misc Normal file
View file

@ -0,0 +1 @@
Remove unused variables.

View file

@ -46,7 +46,7 @@ from synapse.storage.roommember import (
ProfileInfo, ProfileInfo,
RoomsForUser, 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.async_helpers import Linearizer
from synapse.util.caches import intern_string from synapse.util.caches import intern_string
from synapse.util.caches.descriptors import _CacheContext, cached, cachedList from synapse.util.caches.descriptors import _CacheContext, cached, cachedList
@ -273,7 +273,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
txn.execute(sql, (room_id,)) txn.execute(sql, (room_id,))
res = {} res = {}
for count, membership in txn: 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 # we order by membership and then fairly arbitrarily by event_id so
# heroes are consistent # heroes are consistent
@ -839,18 +839,14 @@ class RoomMemberWorkerStore(EventsWorkerStore):
with Measure(self._clock, "get_joined_hosts"): with Measure(self._clock, "get_joined_hosts"):
return await self._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) @cached(num_args=2, max_entries=10000, iterable=True)
async def _get_joined_hosts( async def _get_joined_hosts(
self, self, room_id: str, state_group: int, state_entry: "_StateCacheEntry"
room_id: str,
state_group: int,
current_state_ids: StateMap[str],
state_entry: "_StateCacheEntry",
) -> FrozenSet[str]: ) -> FrozenSet[str]:
# We don't use `state_group`, its there so that we can cache based on # We don't use `state_group`, it's there so that we can cache based on
# it. However, its important that its never None, since two # it. However, its important that its never None, since two
# current_state's with a state_group of None are likely to be different. # current_state's with a state_group of None are likely to be different.
# #