Re: PublicationActions - use bit flags. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PublicationActions - use bit flags.
Date
Msg-id 2185490.1640824592@sss.pgh.pa.us
Whole thread Raw
In response to Re: PublicationActions - use bit flags.  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
Peter Smith <smithpb2250@gmail.com> writes:
> On Thu, Dec 30, 2021 at 3:30 AM Justin Pryzby <pryzby@telsasoft.com> wrote:
>> +       if (pubform->pubinsert) pub->pubactions |= PUBACTION_INSERT;
>> This is usually written like:
>> pub->pubactions |= (pubform->pubinsert ? PUBACTION_INSERT : 0)

> Thanks for the info, I've modified those assignment styles as suggested.

FWIW, I think it's utter nonsense to claim that the second way is
preferred over the first.  There may be some people who think
the second way is more legible, but I don't; and I'm pretty sure
that the first way is significantly more common in the PG codebase.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: PublicationActions - use bit flags.
Next
From: Thomas Munro
Date:
Subject: Tests "with" and "alter_table" suffer from name clash