Thread

  1. Re: A minor correction in comment in heaptuple.c

    D'Arcy Cain <darcy@druid.net> — 2013-06-18T17:14:30Z

    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