Re: A minor correction in comment in heaptuple.c

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: A minor correction in comment in heaptuple.c
Дата
Msg-id 20130618052115.4c642841@imp
обсуждение исходный текст
Ответ на Re: A minor correction in comment in heaptuple.c  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: A minor correction in comment in heaptuple.c  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On Tue, 18 Jun 2013 11:01:28 +0200
Andres Freund <andres@2ndquadrant.com> wrote:
> > /*
> >  * return true if attnum is out of range according to the tupdesc
> > */
> > if (attnum > tupleDesc->natts)
> > return true;
> 
> I think the comment is more meaningfull before the change since it
> tells us how nonexisting columns are interpreted.

I think that the comment is bad either way.  Comments should explain
the code, not repeat it.  The above is not far removed from...
 return 5; /* return the number 5 */

How about "check if attnum is out of range according to the tupdesc"
instead?

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VOIP: sip:darcy@Vex.Net



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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: A minor correction in comment in heaptuple.c
Следующее
От: Markus Wanner
Дата:
Сообщение: Re: Change authentication error message (patch)