Re: Unnecessary pointer-NULL checks in pgp-pgsql.c - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Unnecessary pointer-NULL checks in pgp-pgsql.c
Date
Msg-id CA+Tgmoa4a2R1O1CWZ--1mLK2VdL1+2r-7SCikXTwDwR6gy9VUw@mail.gmail.com
Whole thread Raw
In response to Re: Unnecessary pointer-NULL checks in pgp-pgsql.c  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Unnecessary pointer-NULL checks in pgp-pgsql.c  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Wed, Feb 4, 2015 at 7:00 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Robert Haas wrote:
>> I wrote:
>>> src, dst and ctx are created respectively from mbuf_create_from_data,
>>> mbuf_create and pgp_init which never return NULL and they are palloc'd
>>> all the time. I think that we could simplify things with the patch
>>> attached, note that I added an assertion for correctness but I don't
>>> really think that it is much necessary.
>>
>> Yeah, I'd drop the assertion.  Also, how about changing things around
>> slightly so that we lose the goto-label construct?  There's only one
>> goto, and its only about 6 lines before the label, so we could just
>> flip the sense of the if-test and put the code that gets skipped
>> inside the if-block.
> Good idea. This gives the patch attached then.

Committed.

(BTW, why do you not leave a blank line between quoted text and your responses?)

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Getting rid of wal_level=archive and default to hot_standby + wal_senders
Next
From: Robert Haas
Date:
Subject: Re: pg_dump's aborted transactions