Re: small pg_dump code cleanup
От | Neil Conway |
---|---|
Тема | Re: small pg_dump code cleanup |
Дата | |
Msg-id | CAOW5sYZY3sdSxzaRwQCMMNtsZ_1jN+AFzB82k58==Vome-G11w@mail.gmail.com обсуждение исходный текст |
Ответ на | small pg_dump code cleanup (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: small pg_dump code cleanup
|
Список | pgsql-hackers |
On Wed, Jun 5, 2024 at 11:14 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
In fact, many of the functions in this area don't actually need to
return anything, so we can trim some code and hopefully reduce confusion a
bit. Patch attached.
Nice cleanup! Two minor comments:
(1) Names like `getXXX` for these functions suggest to me that they return a value, rather than side-effecting. I realize some variants continue to return a value, but the majority no longer do. Perhaps a name like lookupXXX() or readXXX() would be clearer?
(2) These functions malloc() a single ntups * sizeof(struct) allocation and then index into it to fill-in each struct before entering it into the hash table. It might be more straightforward to just malloc each individual struct.
Neil
В списке pgsql-hackers по дате отправления: