Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls
От | Andrew Dunstan |
---|---|
Тема | Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls |
Дата | |
Msg-id | 8770ae0a-0ee7-450d-83b1-c610cfa2b1ec@dunslane.net обсуждение исходный текст |
Ответ на | remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls (Mahendra Singh Thalor <mahi6run@gmail.com>) |
Ответы |
Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls
Re: remove unnecessary explicit type conversion (to char) for appendStringInfoChar function calls |
Список | pgsql-hackers |
On 2025-04-11 Fr 1:36 PM, Mahendra Singh Thalor wrote: > Hi, > In the current master code, 3 places we are using appendStringInfoChar > call with explicit type conversion into char. This is not needed as > all other places, we are using direct character to append. > > --- a/src/backend/tcop/postgres.c > +++ b/src/backend/tcop/postgres.c > @@ -302,7 +302,7 @@ InteractiveBackend(StringInfo inBuf) > */ > > /* Add '\0' to make it look the same as message case. */ > - appendStringInfoChar(inBuf, (char) '\0'); > + appendStringInfoChar(inBuf, '\0'); > > Here, I am attaching a small patch to fix these 3 type conversions on head. > Seems odd that this one is necessary at all. Doesn't a StringInfo always have a trailing null byte? cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: