Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 572e3e6

Browse files
committed
Initialize structure at declaration
Avoids extra memset call and cast. Discussion: https://www.postgresql.org/message-id/flat/7a5cbea7-b8df-e910-0f10-04014bcad701%402ndquadrant.com
1 parent 9a8ee1d commit 572e3e6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

contrib/dblink/dblink.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,13 +982,11 @@ materializeQueryResult(FunctionCallInfo fcinfo,
982982
{
983983
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
984984
PGresult *volatile res = NULL;
985-
volatile storeInfo sinfo;
985+
volatile storeInfo sinfo = {0};
986986

987987
/* prepTuplestoreResult must have been called previously */
988988
Assert(rsinfo->returnMode == SFRM_Materialize);
989989

990-
/* initialize storeInfo to empty */
991-
memset((void *) &sinfo, 0, sizeof(sinfo));
992990
sinfo.fcinfo = fcinfo;
993991

994992
PG_TRY();

0 commit comments

Comments
 (0)