Drop empty-input guards from batch loaders

ANY(@ids) with an empty array is valid in Postgres and
CollectRows already yields an empty slice; the early nil
assignments added noise without changing callers.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-29 21:09:16 +00:00
parent 0e05fca7fc
commit b715107e6c
3 changed files with 0 additions and 18 deletions

View File

@@ -393,12 +393,6 @@ func (i *Identities) LoadByIDs(
conn pg.Querier, conn pg.Querier,
identityIDs []gid.GID, identityIDs []gid.GID,
) error { ) error {
if len(identityIDs) == 0 {
*i = nil
return nil
}
q := ` q := `
SELECT SELECT
id, id,

View File

@@ -502,12 +502,6 @@ func (p *MembershipProfiles) LoadByOrganizationIDAndUserNames(
organizationID gid.GID, organizationID gid.GID,
userNames []string, userNames []string,
) error { ) error {
if len(userNames) == 0 {
*p = nil
return nil
}
q := ` q := `
SELECT SELECT
p.id, p.id,

View File

@@ -307,12 +307,6 @@ func (a *PersonalAPIKeys) LoadByIDs(
conn pg.Querier, conn pg.Querier,
apiKeyIDs []gid.GID, apiKeyIDs []gid.GID,
) error { ) error {
if len(apiKeyIDs) == 0 {
*a = nil
return nil
}
q := ` q := `
SELECT SELECT
id, id,