do I really understand this or not ?

Hi,
 I've found something odd with the HTList_firstObject() function. My
read on this is that it should return a pointer to the first object in
the list. Running some tests shows that this doesn't happen.
  After looking at the source it seems (to my naive eye) that this
routine will always return NULL.
    Here's the source I have with a mod that I put in to make it work
the way I _think_ it's supposed to.
Could someone more knowledgable please comment on this please ?

    Thanks,
        G
--------------- snip -----------------------
PUBLIC void * HTList_firstObject  (HTList * me)
{
/* This is the original code
    if (me && me->next) {
        HTList * prevNode;
        while (me->next) {
            prevNode = me;
            me = me->next;
        }
        return me->object;
    } else
        return NULL;
*/
/* This is my new stuff */
    if (me && me->next)
     {
      return me->next->object;
     }
    return NULL;
}

Received on Thursday, 8 June 2000 14:57:00 UTC