Re: Support isEmptyStringInfo - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Support isEmptyStringInfo
Date
Msg-id CA+TgmoaeuFSi5HBgBGO95ZnSnxgGDVLfwX=SSg6yDS6w1fahvg@mail.gmail.com
Whole thread Raw
Responses Re: Support isEmptyStringInfo  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Mar 23, 2022 at 8:33 AM Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
> We have (StringInfo::len == 0) checks at many places. I thought it
> would be better to wrap that into a function isEmptyStringInfo() to
> make those checks more readable and also abstract the logic to check
> emptiness of a StringInfo. I think this will be useful to extensions
> outside core which also have these checks. They won't need to worry
> about that logic/code being changed in future; rare but not impossible
> case.

I think that the code is perfectly readable as it is and that this
change makes it less so.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Support isEmptyStringInfo
Next
From: Petr Jelinek
Date:
Subject: Re: logical decoding and replication of sequences