httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-1.3/src/modules/standard mod_rewrite.c
Date Fri, 14 Jul 2000 20:01:56 GMT
rse         00/07/14 13:01:55

  Modified:    src/modules/standard mod_rewrite.c
  Log:
  Replace this unknown hash function someone contributed with the classical DJB
  times 33 hash (using XOR instead of ADD).  This hash is better understood and
  is faster. Also because in the old function the "& 0xff" was not necessary and
  just slowed down processing.
  
  Revision  Changes    Path
  1.158     +2 -2      apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.157
  retrieving revision 1.158
  diff -u -r1.157 -r1.158
  --- mod_rewrite.c	2000/06/01 23:42:28	1.157
  +++ mod_rewrite.c	2000/07/14 20:01:55	1.158
  @@ -3856,8 +3856,8 @@
       char *p;
   
       n = 0;
  -    for (p=key; *p != '\0'; ++p) {
  -        n = n * 53711 + 134561 + (unsigned)(*p & 0xff);
  +    for (p = key; *p != '\0'; p++) {
  +        n = ((n << 5) + n) ^ (unsigned long)(*p++);
       }
   
       return (int)(n % CACHE_TLB_ROWS);
  
  
  

Mime
View raw message