Re: GinPageIs* don't actually return a boolean - Mailing list pgsql-hackers

From Tom Lane
Subject Re: GinPageIs* don't actually return a boolean
Date
Msg-id 29719.1439420630@sss.pgh.pa.us
Whole thread Raw
In response to Re: GinPageIs* don't actually return a boolean  (Andres Freund <andres@anarazel.de>)
Responses Re: GinPageIs* don't actually return a boolean
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2015-08-12 18:52:59 -0400, Tom Lane wrote:
>> Looks OK to me, except I wonder why you did this
>> 
>> #define TRIGGER_FIRED_FOR_ROW(event) \
>> -    ((event) & TRIGGER_EVENT_ROW)
>> +    (((event) & TRIGGER_EVENT_ROW) == TRIGGER_EVENT_ROW)
>> 
>> rather than != 0.  That way doesn't look either more efficient or
>> more readable.

> Purely consistency with the surrounding code. I was on the fence about
> that one...

The adjacent code is doing something different than a bit-test, though:
it's checking whether multibit fields have particular values.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: GinPageIs* don't actually return a boolean
Next
From: Andres Freund
Date:
Subject: Re: GinPageIs* don't actually return a boolean