From 2375a13af441c2ead90f1c7e9b30d4a5a2633a70 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 11 Oct 2023 17:37:24 +0100 Subject: [PATCH] Return early if there are no invites to remove --- state/invites_table.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/state/invites_table.go b/state/invites_table.go index 874491f..415999b 100644 --- a/state/invites_table.go +++ b/state/invites_table.go @@ -77,6 +77,10 @@ func (t *InvitesTable) RemoveSupersededInvites(txn *sqlx.Tx, roomID string, newE } } + if len(usersToRemove) == 0 { + return nil + } + _, err := txn.Exec(` DELETE FROM syncv3_invites WHERE user_id = ANY($1) AND room_id = $2