Re: Remove redundant initializations

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove redundant initializations
Date: 2021-07-15 12:03:17
Message-ID: CALDaNm0vHKUOvdzJ7DTJDofBNHrKKZazxA_EZ6S6m9kSAWAaNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 28, 2021 at 3:30 PM Peter Eisentraut
<peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
>
> There are certain parts of code that laboriously initialize every field
> of a struct to (some spelling of) zero, even though the whole struct was
> just zeroed (by makeNode() or memset()) a few lines earlier. Besides
> being redundant, I find this hard to read in some situations because
> it's then very hard to tell what is different between different cases or
> branches. The attached patch cleans up most of that. I left alone
> instances where there are (nontrivial) comments attached to the
> initializations or where there appeared to be some value in maintaining
> symmetry. But a lot of it was just plain useless code, some clearly
> copy-and-pasted repeatedly.
>
> Note
> <https://www.postgresql.org/message-id/flat/4c9f01be-9245-2148-b569-61a8562ef190(at)2ndquadrant(dot)com>
> where we had a previous discussion about trimming down useless
> initializations to zero.

The patch does not apply on Head anymore, could you rebase and post a
patch. I'm changing the status to "Waiting for Author".

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-07-15 12:05:23 Re: Removing unneeded self joins
Previous Message John Naylor 2021-07-15 11:57:54 Re: A qsort template