apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: Hash?
Date Tue, 02 Jan 2001 02:11:24 GMT

> This was suggested by Carlos Hasan mailto:chasan@acm.org but as I'm not
> overly familiar with the hashing code I'm putting it forward rather than
> committing it :)

>       */
>      hash = 0;
>      for (p = key, i = klen; i; i--, p++)
> -       hash = hash * 33 + *p;
> +        hash += (hash << 5) + *p;
> +
>      /* scan linked list */
>      for (hep = &ht->array[hash & ht->max], he = *hep;
>          he;

Ummmm,  those aren't equal.  :-)  I seem to remember that Tony had a very
good reason for choosing (hash * 33).  We seem to have had this
conversation in the past on new-httpd.  I would need to search the
archives, which is not easy right now.  I believe Tony is not monitoring
this list right now, but I'll try to get an answer from him tomorrow.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message