Skip to content

Commit c5b0582

Browse files
committed
Replace more MemSet calls with struct initialization
This fixes up 10ea0f9 to use the style introduced by 9fd4587. Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAMbWs490gJf5A=ydqyjh+Z8mVQa_foTGtcmBtHGLra0aOwLWHQ@mail.gmail.com
1 parent bf09437 commit c5b0582

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/backend/utils/adt/pgstatfuncs.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,15 +709,11 @@ pg_stat_get_backend_subxact(PG_FUNCTION_ARGS)
709709
{
710710
#define PG_STAT_GET_SUBXACT_COLS 2
711711
TupleDesc tupdesc;
712-
Datum values[PG_STAT_GET_SUBXACT_COLS];
713-
bool nulls[PG_STAT_GET_SUBXACT_COLS];
712+
Datum values[PG_STAT_GET_SUBXACT_COLS] = {0};
713+
bool nulls[PG_STAT_GET_SUBXACT_COLS] = {0};
714714
int32 beid = PG_GETARG_INT32(0);
715715
LocalPgBackendStatus *local_beentry;
716716

717-
/* Initialise values and NULL flags arrays */
718-
MemSet(values, 0, sizeof(values));
719-
MemSet(nulls, 0, sizeof(nulls));
720-
721717
/* Initialise attributes information in the tuple descriptor */
722718
tupdesc = CreateTemplateTupleDesc(PG_STAT_GET_SUBXACT_COLS);
723719
TupleDescInitEntry(tupdesc, (AttrNumber) 1, "subxact_count",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy