Avoid unnecessary MemSet call
authorPeter Eisentraut <[email protected]>
Thu, 30 Jun 2022 18:10:13 +0000 (19:10 +0100)
committerPeter Eisentraut <[email protected]>
Thu, 30 Jun 2022 18:10:13 +0000 (19:10 +0100)
The variable in question was changed from a struct to a pointer some
time ago (77947c51c08).  Using MemSet to zero it still works but is
obviously unidiomatic and confusing, so change it to a straight
assignment.

Author: Ranier Vilela <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CAEudQApCeq4JjW1BdnwU=m=-DvG5WyUik0Yfn3p6UNphiHjj+w@mail.gmail.com

src/backend/utils/cache/relcache.c

index 0e8fda97f862191d52913cbdb09e192311d13f0a..f502df91dca51fabe9af9ba84f1bb33a1c8ae43a 100644 (file)
@@ -6258,7 +6258,7 @@ load_relcache_init_file(bool shared)
        rel->rd_firstRelfilenodeSubid = InvalidSubTransactionId;
        rel->rd_droppedSubid = InvalidSubTransactionId;
        rel->rd_amcache = NULL;
-       MemSet(&rel->pgstat_info, 0, sizeof(rel->pgstat_info));
+       rel->pgstat_info = NULL;
 
        /*
         * Recompute lock and physical addressing info.  This is needed in