aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-11-12 11:50:28 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-11-12 11:50:28 -0500
commit3de491482b6c815a2e735dbbb8972e0907d75188 (patch)
tree376e0de776cd4f86522e3ee60374da44d1d0f21b /src
parente3f005d974ce32ca9f74328067efafcb1217c87f (diff)
downloadpostgresql-3de491482b6c815a2e735dbbb8972e0907d75188.tar.gz
postgresql-3de491482b6c815a2e735dbbb8972e0907d75188.zip
Simplify null-element handling in extension_config_remove().
There's no point in asking deconstruct_array() for a null-flags array when we already checked the array has no nulls, and aren't going to examine the output anyhow. Not asking for this output should make the code marginally faster, and it's also more robust since if there somehow were nulls, deconstruct_array() would throw an error. Daniel Gustafsson Discussion: https://postgr.es/m/289FFB8B-7AAB-48B5-A497-6E0D41D7BA47@yesql.se
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/extension.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 2d761a5773f..560064d3e1f 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -2597,14 +2597,13 @@ extension_config_remove(Oid extensionoid, Oid tableoid)
{
/* squeeze out the target element */
Datum *dvalues;
- bool *dnulls;
int nelems;
int i;
+ /* We already checked there are no nulls */
deconstruct_array(a, OIDOID, sizeof(Oid), true, 'i',
- &dvalues, &dnulls, &nelems);
+ &dvalues, NULL, &nelems);
- /* We already checked there are no nulls, so ignore dnulls */
for (i = arrayIndex; i < arrayLength - 1; i++)
dvalues[i] = dvalues[i + 1];
@@ -2644,14 +2643,13 @@ extension_config_remove(Oid extensionoid, Oid tableoid)
{
/* squeeze out the target element */
Datum *dvalues;
- bool *dnulls;
int nelems;
int i;
+ /* We already checked there are no nulls */
deconstruct_array(a, TEXTOID, -1, false, 'i',
- &dvalues, &dnulls, &nelems);
+ &dvalues, NULL, &nelems);
- /* We already checked there are no nulls, so ignore dnulls */
for (i = arrayIndex; i < arrayLength - 1; i++)
dvalues[i] = dvalues[i + 1];