mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
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
This commit is contained in:
parent
9a8ee1dc65
commit
572e3e6634
@ -982,13 +982,11 @@ materializeQueryResult(FunctionCallInfo fcinfo,
|
||||
{
|
||||
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
|
||||
PGresult *volatile res = NULL;
|
||||
volatile storeInfo sinfo;
|
||||
volatile storeInfo sinfo = {0};
|
||||
|
||||
/* prepTuplestoreResult must have been called previously */
|
||||
Assert(rsinfo->returnMode == SFRM_Materialize);
|
||||
|
||||
/* initialize storeInfo to empty */
|
||||
memset((void *) &sinfo, 0, sizeof(sinfo));
|
||||
sinfo.fcinfo = fcinfo;
|
||||
|
||||
PG_TRY();
|
||||
|
Loading…
Reference in New Issue
Block a user