From: | "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net> |
---|---|
To: | Andres Freund <andres(at)2ndquadrant(dot)com> |
Cc: | Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: A minor correction in comment in heaptuple.c |
Date: | 2013-06-18 17:14:30 |
Message-ID: | 20130618131430.4668db12@imp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, 18 Jun 2013 11:38:45 +0200
Andres Freund <andres(at)2ndquadrant(dot)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(at)druid(dot)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(at)Vex(dot)Net, VOIP: sip:darcy(at)Vex(dot)Net
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2013-06-18 17:19:40 | Re: A minor correction in comment in heaptuple.c |
Previous Message | Hitoshi Harada | 2013-06-18 17:13:39 | Re: extensible external toast tuple support |