aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-11-29 00:09:17 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-11-29 00:09:17 -0300
commitcce3d72a8a42be2db18aaabbf100f8e0f540206c (patch)
treeb13040a7319035dbe6b53df13597e756a13db5f1 /src
parentd4607590b6d8431906163280704e4023c625670c (diff)
downloadpostgresql-cce3d72a8a42be2db18aaabbf100f8e0f540206c.tar.gz
postgresql-cce3d72a8a42be2db18aaabbf100f8e0f540206c.zip
Make memset() use sizeof() rather than re-compute size
This is simpler and more closely follows overwhelming precedent. Report and patch by Mark Dilger. Discussion: https://postgr.es/m/9A68FB88-5F45-4848-9926-8586E2D777D1@gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/statistics/extended_stats.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/statistics/extended_stats.c b/src/backend/statistics/extended_stats.c
index eeed56ff0aa..26c2aedd36c 100644
--- a/src/backend/statistics/extended_stats.c
+++ b/src/backend/statistics/extended_stats.c
@@ -301,9 +301,9 @@ statext_store(Relation pg_stext, Oid statOid,
bool nulls[Natts_pg_statistic_ext];
bool replaces[Natts_pg_statistic_ext];
- memset(nulls, 1, Natts_pg_statistic_ext * sizeof(bool));
- memset(replaces, 0, Natts_pg_statistic_ext * sizeof(bool));
- memset(values, 0, Natts_pg_statistic_ext * sizeof(Datum));
+ memset(nulls, true, sizeof(nulls));
+ memset(replaces, false, sizeof(replaces));
+ memset(values, 0, sizeof(values));
/*
* Construct a new pg_statistic_ext tuple, replacing the calculated stats.