summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrewm@element.io>2022-08-04 14:15:33 +0100
committerAndrew Morgan <andrewm@element.io>2022-08-04 14:15:37 +0100
commit8346060c06b19c2a246506e0525e6bd393489884 (patch)
treee604ee2062b97d8a7e653eaad4a5f9235298cdc5
parentRevert "Allow deleting all rows when passing empty keyvalues dict to simple_d... (diff)
downloadsynapse-8346060c06b19c2a246506e0525e6bd393489884.tar.xz
Remove unnecessary if condition
'clauses' will always be non-None.
-rw-r--r--synapse/storage/database.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py
index b394a6658b..46be3b3876 100644
--- a/synapse/storage/database.py
+++ b/synapse/storage/database.py
@@ -2195,8 +2195,7 @@ class DatabasePool:
             clauses.append("%s = ?" % (key,))
             values.append(value)
 
-        if clauses:
-            sql = "%s WHERE %s" % (sql, " AND ".join(clauses))
+        sql = "%s WHERE %s" % (sql, " AND ".join(clauses))
         txn.execute(sql, values)
 
         return txn.rowcount