summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-07-16 08:42:15 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-07-16 08:50:49 +0200
commit9fd45870c1436b477264c0c82eb195df52bc0919 (patch)
tree10a09724c0bcffa8f58f262e50c3260cde484446 /src/backend/optimizer
parentc94ae9d827a360d74da6a304692d34a4dc8b6445 (diff)
Replace many MemSet calls with struct initialization
This replaces all MemSet() calls with struct initialization where that is easily and obviously possible. (For example, some cases have to worry about padding bits, so I left those.) (The same could be done with appropriate memset() calls, but this patch is part of an effort to phase out MemSet(), so it doesn't touch memset() calls.) Reviewed-by: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://www.postgresql.org/message-id/9847b13c-b785-f4e2-75c3-12ec77a3b05c@enterprisedb.com
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/path/costsize.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 5e5732f6e12..190302b9bde 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -2926,13 +2926,12 @@ cost_agg(Path *path, PlannerInfo *root,
double output_tuples;
Cost startup_cost;
Cost total_cost;
- AggClauseCosts dummy_aggcosts;
+ const AggClauseCosts dummy_aggcosts = {0};
/* Use all-zero per-aggregate costs if NULL is passed */
if (aggcosts == NULL)
{
Assert(aggstrategy == AGG_HASHED);
- MemSet(&dummy_aggcosts, 0, sizeof(AggClauseCosts));
aggcosts = &dummy_aggcosts;
}