summaryrefslogtreecommitdiff
path: root/internal/db/bundb/instance.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-05 12:34:37 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-05 12:34:37 +0200
commitd9c69f6ce05daddf2f6d5d8c6c03b4c3d55df93a (patch)
tree7ee20e4665bdad322321dc10f59175f7b076a7ba /internal/db/bundb/instance.go
parent[chore/bugfix] Break Websockets logic into smaller read/write functions, don'... (diff)
downloadgotosocial-d9c69f6ce05daddf2f6d5d8c6c03b4c3d55df93a.tar.xz
[chore/performance] Remove remaining 'whereEmptyOrNull' funcs (#1946)
Diffstat (limited to 'internal/db/bundb/instance.go')
-rw-r--r--internal/db/bundb/instance.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/db/bundb/instance.go b/internal/db/bundb/instance.go
index 4fa898639..95f6ad5b8 100644
--- a/internal/db/bundb/instance.go
+++ b/internal/db/bundb/instance.go
@@ -39,8 +39,9 @@ func (i *instanceDB) CountInstanceUsers(ctx context.Context, domain string) (int
Where("? IS NULL", bun.Ident("account.suspended_at"))
if domain == config.GetHost() || domain == config.GetAccountDomain() {
- // if the domain is *this* domain, just count where the domain field is null
- q = q.WhereGroup(" AND ", whereEmptyOrNull("account.domain"))
+ // If the domain is *this* domain, just
+ // count where the domain field is null.
+ q = q.Where("? IS NULL", bun.Ident("account.domain"))
} else {
q = q.Where("? = ?", bun.Ident("account.domain"), domain)
}