Re: PATCH: CreateComments: use explicit indexing for ``values''

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: PATCH: CreateComments: use explicit indexing for ``values''
Дата
Msg-id BANLkTimsw5Q4OnW7CgZ_=TfNN5cpoCDSTg@mail.gmail.com
обсуждение исходный текст
Ответ на PATCH: CreateComments: use explicit indexing for ``values''  (richhguard-monotone@yahoo.co.uk)
Ответы Re: PATCH: CreateComments: use explicit indexing for ``values''  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, Jun 12, 2011 at 7:26 AM,  <richhguard-monotone@yahoo.co.uk> wrote:
> Hello,
> I'm new to PostgreSQL and git, but having read through the wiki entries such as
http://wiki.postgresql.org/wiki/Submitting_a_Patch,I think I have a patch worthy of submission.
 
>
> It's a readability improvement in src/backend/commands/comment.c (CreateComments function), which changes the
existingcode from incrementing a variable for use as the array index, to use explicit ``values'' instead.
 
>
> This has the following benefits
>
> 1) The structure of ``values'' is now clear at first glance.
> 2) ``i'' is then only used for 1 reason; the for loop
>
> The patch is based on "master", and all existing tests pass.

Wow.  That code is pretty ugly, all right.  I think, though, that we
probably ought to be using the Apg_description_<columnname> constants
instead of writing 0-3.  Care to update the patch?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [v9.1] sepgsql - userspace access vector cache
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Make relation_openrv atomic wrt DDL