From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Alexander Korotkov <akorotkov@postgresql.org>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex
Date: Sun, 17 Mar 2019 15:09:07 +0300
Message-ID: <CAPpHfdtmREDU2eAT4gMDjJRJtFEvMU=tOOzWeeCAPMwofEDXJQ@mail.gmail.com> (raw)
In-Reply-To: <ecfcfb5f-3233-eaa9-0c83-07056fb49a83@2ndquadrant.com>
References: <E1h5Sa8-0007FZ-Co@gemulon.postgresql.org>
<ecfcfb5f-3233-eaa9-0c83-07056fb49a83@2ndquadrant.com>
On Sun, Mar 17, 2019 at 3:00 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 2019-03-17 10:59, Alexander Korotkov wrote:
> > Beautify initialization of JsonValueList and JsonLikeRegexContext
> >
> > Instead of tricky assignment to {0} introduce special macros, which
> > explicitly initialize every field.
>
> To me, this patch is exactly the opposite of what I'd do to "beautify
> initialization". It doesn't seem sustainable to me to create a special
> macro for every structure in the code, not does it improve readability.
> It is much clearer that {0} is uniformly the starting state.
I got two reasons in the mind while committing that:
1) We would probably like to make some values of empty state non-zero in future.
2) In general, it's better to not assume that NULL is binary zero.
However, we assume that a lot in other places. So, it probably
doesn't matter.
Anyway, I thought about this as about just beautification. If it's
bad idea, let's revert this.
------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: a.korotkov@postgrespro.ru, peter.eisentraut@2ndquadrant.com, akorotkov@postgresql.org
Subject: Re: pgsql: Beautify initialization of JsonValueList and JsonLikeRegexContex
In-Reply-To: <CAPpHfdtmREDU2eAT4gMDjJRJtFEvMU=tOOzWeeCAPMwofEDXJQ@mail.gmail.com>
References: <E1h5Sa8-0007FZ-Co@gemulon.postgresql.org> <ecfcfb5f-3233-eaa9-0c83-07056fb49a83@2ndquadrant.com> <CAPpHfdtmREDU2eAT4gMDjJRJtFEvMU=tOOzWeeCAPMwofEDXJQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox