Re: [HACKERS] C question about bitmasks in datetime.c

2013-10-01 Thread Bruce Momjian
On Tue, Oct 1, 2013 at 05:17:35PM +0200, Andres Freund wrote: > On 2013-10-01 11:15:36 -0400, Bruce Momjian wrote: > > I see a few cases of this code in src/backend/utils/adt/datetime.c: > > > > else if ((fmask & DTK_DATE_M) != DTK_DATE_M) > > > > Wouldn't this be clearer as: > > > > el

Re: [HACKERS] C question about bitmasks in datetime.c

2013-10-01 Thread Andres Freund
On 2013-10-01 11:15:36 -0400, Bruce Momjian wrote: > I see a few cases of this code in src/backend/utils/adt/datetime.c: > > else if ((fmask & DTK_DATE_M) != DTK_DATE_M) > > Wouldn't this be clearer as: > > else if (fmask & DTK_DATE_M) That doesn't have the same meaning. The latter is t

[HACKERS] C question about bitmasks in datetime.c

2013-10-01 Thread Bruce Momjian
I see a few cases of this code in src/backend/utils/adt/datetime.c: else if ((fmask & DTK_DATE_M) != DTK_DATE_M) Wouldn't this be clearer as: else if (fmask & DTK_DATE_M) -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com