Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3de4914

Browse files
committed
Simplify null-element handling in extension_config_remove().
There's no point in asking deconstruct_array() for a null-flagsarray when we already checked the array has no nulls, and aren'tgoing to examine the output anyhow. Not asking for this outputshould make the code marginally faster, and it's also morerobust since if there somehow were nulls, deconstruct_array()would throw an error.Daniel GustafssonDiscussion:https://postgr.es/m/289FFB8B-7AAB-48B5-A497-6E0D41D7BA47@yesql.se
1 parente3f005d commit3de4914

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎src/backend/commands/extension.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,14 +2597,13 @@ extension_config_remove(Oid extensionoid, Oid tableoid)
25972597
{
25982598
/* squeeze out the target element */
25992599
Datum*dvalues;
2600-
bool*dnulls;
26012600
intnelems;
26022601
inti;
26032602

2603+
/* We already checked there are no nulls */
26042604
deconstruct_array(a,OIDOID,sizeof(Oid), true,'i',
2605-
&dvalues,&dnulls,&nelems);
2605+
&dvalues,NULL,&nelems);
26062606

2607-
/* We already checked there are no nulls, so ignore dnulls */
26082607
for (i=arrayIndex;i<arrayLength-1;i++)
26092608
dvalues[i]=dvalues[i+1];
26102609

@@ -2644,14 +2643,13 @@ extension_config_remove(Oid extensionoid, Oid tableoid)
26442643
{
26452644
/* squeeze out the target element */
26462645
Datum*dvalues;
2647-
bool*dnulls;
26482646
intnelems;
26492647
inti;
26502648

2649+
/* We already checked there are no nulls */
26512650
deconstruct_array(a,TEXTOID,-1, false,'i',
2652-
&dvalues,&dnulls,&nelems);
2651+
&dvalues,NULL,&nelems);
26532652

2654-
/* We already checked there are no nulls, so ignore dnulls */
26552653
for (i=arrayIndex;i<arrayLength-1;i++)
26562654
dvalues[i]=dvalues[i+1];
26572655

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp