1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-06 13:46:51 +03:00

Collect duplicate copies of oid_cmp()

This commit is contained in:
Peter Eisentraut
2017-03-01 11:55:28 -05:00
parent 788af6f854
commit 20f6d74242
5 changed files with 17 additions and 51 deletions

View File

@@ -88,7 +88,6 @@ static void check_circularity(const Acl *old_acl, const AclItem *mod_aip,
Oid ownerId);
static Acl *recursive_revoke(Acl *acl, Oid grantee, AclMode revoke_privs,
Oid ownerId, DropBehavior behavior);
static int oidComparator(const void *arg1, const void *arg2);
static AclMode convert_priv_string(text *priv_type_text);
static AclMode convert_any_priv_string(text *priv_type_text,
@@ -1490,7 +1489,7 @@ aclmembers(const Acl *acl, Oid **roleids)
}
/* Sort the array */
qsort(list, j, sizeof(Oid), oidComparator);
qsort(list, j, sizeof(Oid), oid_cmp);
/* Remove duplicates from the array */
k = 0;
@@ -1509,23 +1508,6 @@ aclmembers(const Acl *acl, Oid **roleids)
return k + 1;
}
/*
* oidComparator
* qsort comparison function for Oids
*/
static int
oidComparator(const void *arg1, const void *arg2)
{
Oid oid1 = *(const Oid *) arg1;
Oid oid2 = *(const Oid *) arg2;
if (oid1 > oid2)
return 1;
if (oid1 < oid2)
return -1;
return 0;
}
/*
* aclinsert (exported function)