From c6ff0b892c30122b75d32c524109d16ee3c973f0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 14 Mar 2019 13:30:09 +0100 Subject: Refactor ParamListInfo initialization There were six copies of identical nontrivial code. Put it into a function. --- src/backend/tcop/postgres.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 8b4d94c9a13..f9ce3d8f22a 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1731,16 +1731,7 @@ exec_bind_message(StringInfo input_message) */ if (numParams > 0) { - params = (ParamListInfo) palloc(offsetof(ParamListInfoData, params) + - numParams * sizeof(ParamExternData)); - /* we have static list of params, so no hooks needed */ - params->paramFetch = NULL; - params->paramFetchArg = NULL; - params->paramCompile = NULL; - params->paramCompileArg = NULL; - params->parserSetup = NULL; - params->parserSetupArg = NULL; - params->numParams = numParams; + params = makeParamList(numParams); for (int paramno = 0; paramno < numParams; paramno++) { -- cgit v1.2.3