remove useless search in users query
This commit is contained in:
parent
cef8cb0bbf
commit
c2f3e97611
1 changed files with 3 additions and 6 deletions
|
@ -113,11 +113,8 @@ class DataBase:
|
|||
"""
|
||||
|
||||
with self.lock:
|
||||
self.cur.execute("SELECT * FROM users")
|
||||
users = self.cur.fetchall()
|
||||
self.cur.execute("SELECT * FROM users where mxid = ?", [mxid])
|
||||
|
||||
user: dict = next(
|
||||
iter([user for user in users if user["mxid"] == mxid]), {}
|
||||
)
|
||||
user = self.cur.fetchone()
|
||||
|
||||
return user
|
||||
return {} if not user else user
|
||||
|
|
Loading…
Reference in a new issue