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 20130618131430.4668db12@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:38:45 +0200
Andres Freund <andres@2ndquadrant.com> wrote:
> > How about "check if attnum is out of range according to the tupdesc"
> > instead?
> 
> I can't follow. Minus the word 'NULL' - which carries meaning - your
> suggested comment pretty much is the same as the existing comment
> except that you use 'check' instead of 'return'.

The difference is that I say what the purpose of the function is but
don't say what it actually returns.  The code itself does that.

> Original:
>     /*
>      * return NULL if attnum is out of range according to the
> tupdesc */

Obviously wrong so it should be changed.  As for the exact wording,
flip a coin and get the bikeshed painted.  It's not all that critical.
You could probably leave out the comment altogether.  The code is
pretty short and self explanatory.

Perhaps the comment should explain why we don't test for negative
numbers.  I assume that that's an impossible situation.

-- 
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 по дате отправления:

Предыдущее
От: Hitoshi Harada
Дата:
Сообщение: Re: extensible external toast tuple support
Следующее
От: Jeremy Evans
Дата:
Сообщение: LEFT JOIN LATERAL can remove rows from LHS