Support isEmptyStringInfo - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Support isEmptyStringInfo
Date
Msg-id CAExHW5ssGYXcZovQBWYu=7YqcWB7iVwn1cVp_9MKzwgi3mNyYg@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi All,
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.

Probably we should have similar support for PQExpBuffer as well, which
will be more useful to hide  the internals of PQExpBuffer from client
code. But I haven't included those changes in this patch. I can do
that if hackers like the idea.

-- 
Best Wishes,
Ashutosh Bapat

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: make MaxBackends available in _PG_init
Next
From: Robert Haas
Date:
Subject: Re: Support isEmptyStringInfo