Re: libpq: Remove redundant null pointer checks before free()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: libpq: Remove redundant null pointer checks before free()
Дата
Msg-id 2216816.1655660311@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: libpq: Remove redundant null pointer checks before free()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> For PQclear() specifically, one thing that I thought a few days ago
> would be useful would to have it return (PGresult *) NULL.  Then the
> very common pattern of doing "PQclear(res); res = NULL;" could be
> simplified to "res = PQclear(res);", which is nicely compact and is
> learned instantly.

That's a public API unfortunately, and so some people would demand
a libpq.so major version bump if we changed it.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: libpq: Remove redundant null pointer checks before free()
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Add header support to text format and matching feature