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

Commit4572d59

Browse files
committed
Improve style of two code paths
In execGrouping.c, execTuplesMatchPrepare() was doing a memoryallocation that was not necessary when the number of columns was 0.In foreign.c, pg_options_to_table() was assigning twice a variable tothe same value.Author: Ranier VilelaDiscussion:https://postgr.es/m/CAEudQAqup0agbSzMjSLSTn=OANyCzxENF1+HrSYnr3WyZib7=Q@mail.gmail.com
1 parenta9ed7d9 commit4572d59

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎src/backend/executor/execGrouping.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ execTuplesMatchPrepare(TupleDesc desc,
6262
constOid*collations,
6363
PlanState*parent)
6464
{
65-
Oid*eqFunctions= (Oid*)palloc(numCols*sizeof(Oid));
65+
Oid*eqFunctions;
6666
inti;
6767
ExprState*expr;
6868

6969
if (numCols==0)
7070
returnNULL;
7171

72+
eqFunctions= (Oid*)palloc(numCols*sizeof(Oid));
73+
7274
/* lookup equality functions */
7375
for (i=0;i<numCols;i++)
7476
eqFunctions[i]=get_opcode(eqOperators[i]);

‎src/backend/foreign/foreign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ pg_options_to_table(PG_FUNCTION_ARGS)
524524
Datumarray=PG_GETARG_DATUM(0);
525525
ListCell*cell;
526526
List*options;
527-
ReturnSetInfo*rsinfo= (ReturnSetInfo*)fcinfo->resultinfo;
527+
ReturnSetInfo*rsinfo;
528528

529529
options=untransformRelOptions(array);
530530
rsinfo= (ReturnSetInfo*)fcinfo->resultinfo;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp