remove useless search in users query

This commit is contained in:
git-bruh 2021-12-09 13:37:58 +05:30
parent cef8cb0bbf
commit c2f3e97611
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -113,11 +113,8 @@ class DataBase:
""" """
with self.lock: with self.lock:
self.cur.execute("SELECT * FROM users") self.cur.execute("SELECT * FROM users where mxid = ?", [mxid])
users = self.cur.fetchall()
user: dict = next( user = self.cur.fetchone()
iter([user for user in users if user["mxid"] == mxid]), {}
)
return user return {} if not user else user