summaryrefslogtreecommitdiff
path: root/contrib/pgstattuple/pgstatindex.c
diff options
context:
space:
mode:
authorPeter Eisentraut2022-07-16 06:42:15 +0000
committerPeter Eisentraut2022-07-16 06:50:49 +0000
commit9fd45870c1436b477264c0c82eb195df52bc0919 (patch)
tree10a09724c0bcffa8f58f262e50c3260cde484446 /contrib/pgstattuple/pgstatindex.c
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 'contrib/pgstattuple/pgstatindex.c')
-rw-r--r--contrib/pgstattuple/pgstatindex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c
index e1048e47ff3..d69ac1c93df 100644
--- a/contrib/pgstattuple/pgstatindex.c
+++ b/contrib/pgstattuple/pgstatindex.c
@@ -575,7 +575,7 @@ pgstathashindex(PG_FUNCTION_ARGS)
HeapTuple tuple;
TupleDesc tupleDesc;
Datum values[8];
- bool nulls[8];
+ bool nulls[8] = {0};
Buffer metabuf;
HashMetaPage metap;
float8 free_percent;
@@ -697,7 +697,6 @@ pgstathashindex(PG_FUNCTION_ARGS)
/*
* Build and return the tuple
*/
- MemSet(nulls, 0, sizeof(nulls));
values[0] = Int32GetDatum(stats.version);
values[1] = Int64GetDatum((int64) stats.bucket_pages);
values[2] = Int64GetDatum((int64) stats.overflow_pages);