Remove unnecessary list creation in mysql functions.

This commit is contained in:
Jennifer Taylor
2023-03-19 05:23:35 +00:00
parent 284153ef2e
commit 64aeeafbc6
8 changed files with 225 additions and 279 deletions

View File

@@ -55,7 +55,7 @@ class APIData(APIProviderInterface, BaseData):
result["name"],
result["token"],
)
for result in cursor.fetchall()
for result in cursor
]
def validate_client(self, token: str) -> bool:
@@ -159,7 +159,7 @@ class APIData(APIProviderInterface, BaseData):
sql = "SELECT id, timestamp, uri, token, config FROM server ORDER BY timestamp ASC"
cursor = self.execute(sql)
return [format_result(result) for result in cursor.fetchall()]
return [format_result(result) for result in cursor]
def create_server(self, uri: str, token: str) -> int:
"""