mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 14:06:02 -04:00
Remove unnecessary parentheses around tuples returned from methods (#10889)
This commit is contained in:
parent
26f2bfedbf
commit
aa2c027792
22 changed files with 33 additions and 32 deletions
|
@ -324,7 +324,7 @@ class AccountDataWorkerStore(SQLBaseStore):
|
|||
user_id, int(stream_id)
|
||||
)
|
||||
if not changed:
|
||||
return ({}, {})
|
||||
return {}, {}
|
||||
|
||||
return await self.db_pool.runInteraction(
|
||||
"get_updated_account_data_for_user", get_updated_account_data_for_user_txn
|
||||
|
|
|
@ -136,7 +136,7 @@ class DeviceInboxWorkerStore(SQLBaseStore):
|
|||
user_id, last_stream_id
|
||||
)
|
||||
if not has_changed:
|
||||
return ([], current_stream_id)
|
||||
return [], current_stream_id
|
||||
|
||||
def get_new_messages_for_device_txn(txn):
|
||||
sql = (
|
||||
|
@ -240,11 +240,11 @@ class DeviceInboxWorkerStore(SQLBaseStore):
|
|||
)
|
||||
if not has_changed or last_stream_id == current_stream_id:
|
||||
log_kv({"message": "No new messages in stream"})
|
||||
return ([], current_stream_id)
|
||||
return [], current_stream_id
|
||||
|
||||
if limit <= 0:
|
||||
# This can happen if we run out of room for EDUs in the transaction.
|
||||
return ([], last_stream_id)
|
||||
return [], last_stream_id
|
||||
|
||||
@trace
|
||||
def get_new_messages_for_remote_destination_txn(txn):
|
||||
|
|
|
@ -1495,7 +1495,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
if not res:
|
||||
raise SynapseError(404, "Could not find event %s" % (event_id,))
|
||||
|
||||
return (int(res["topological_ordering"]), int(res["stream_ordering"]))
|
||||
return int(res["topological_ordering"]), int(res["stream_ordering"])
|
||||
|
||||
async def get_next_event_to_expire(self) -> Optional[Tuple[str, int]]:
|
||||
"""Retrieve the entry with the lowest expiry timestamp in the event_expiry
|
||||
|
|
|
@ -58,7 +58,7 @@ class StateDeltasStore(SQLBaseStore):
|
|||
# if the CSDs haven't changed between prev_stream_id and now, we
|
||||
# know for certain that they haven't changed between prev_stream_id and
|
||||
# max_stream_id.
|
||||
return (max_stream_id, [])
|
||||
return max_stream_id, []
|
||||
|
||||
def get_current_state_deltas_txn(txn):
|
||||
# First we calculate the max stream id that will give us less than
|
||||
|
|
|
@ -624,7 +624,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore, metaclass=abc.ABCMeta):
|
|||
|
||||
self._set_before_and_after(events, rows)
|
||||
|
||||
return (events, token)
|
||||
return events, token
|
||||
|
||||
async def get_recent_event_ids_for_room(
|
||||
self, room_id: str, limit: int, end_token: RoomStreamToken
|
||||
|
@ -1242,7 +1242,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore, metaclass=abc.ABCMeta):
|
|||
|
||||
self._set_before_and_after(events, rows)
|
||||
|
||||
return (events, token)
|
||||
return events, token
|
||||
|
||||
@cached()
|
||||
async def get_id_for_instance(self, instance_name: str) -> int:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue