Changeset 18 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Jan 28, 2006, 9:07:52 PM (19 years ago)
Author:
rainer
Message:

Optimized version of tiger algorithm, and basic ingredients for unit testing (part 2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r10 r18  
    396396static int hashfunc(char *s)
    397397{
    398   unsigned n = 0;
     398  unsigned int n = 0;
    399399
    400400  for ( ; *s; s++)
    401401    n = 31 * n + *s;
    402   return n & 0xFFFF;/* % TABSIZE*/;
     402
     403  return n & (TABSIZE - 1); /* % TABSIZE */;
    403404}
    404405
Note: See TracChangeset for help on using the changeset viewer.