This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH to hashtable.[ch]: Cache hash value


Neil Booth <neil at daikokuya dot co dot uk> writes:

| Gabriel Dos Reis wrote:-
| 
| > !       if (HT_LEN (node) == len && !memcmp (HT_STR (node), str, len))
| >   	{
| >   	  if (insert == HT_ALLOCED)
| >   	    /* The string we search for was placed at the end of the
| > --- 141,148 ----
| >         if (node == NULL)
| >   	break;
| >   
| > !       if (node->hash_value == hash && HT_LEN (node) == len
| > !           && !memcmp (HT_STR (node), str, len))
| >   	{
| >   	  if (insert == HT_ALLOCED)
| >   	    /* The string we search for was placed at the end of the
| 
| Your call, but is this worth an HT_ accessor like LEN and STR?

I gave that some thought and ended up with the conclusion that there
is really no abstraction about that datatype.  But I would not mind
putting an HT_HASH (although I would personnally get rid o HT_LEN and
HT_STR). 

Do you feel I should introduce HT_HASH  or HT_HASH_VALUE?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]