39 // character, since package names have large common prefixes, and also because |
39 // character, since package names have large common prefixes, and also because |
40 // hash_or_fail does error checking while iterating. |
40 // hash_or_fail does error checking while iterating. |
41 |
41 |
42 // hash P(31) from Kernighan & Ritchie |
42 // hash P(31) from Kernighan & Ritchie |
43 |
43 |
44 inline unsigned int Hashtable::hash_symbol(const char* s, int len) { |
44 inline unsigned int BasicHashtable::hash_symbol(const char* s, int len) { |
45 unsigned int h = 0; |
45 unsigned int h = 0; |
46 while (len-- > 0) { |
46 while (len-- > 0) { |
47 h = 31*h + (unsigned) *s; |
47 h = 31*h + (unsigned) *s; |
48 s++; |
48 s++; |
49 } |
49 } |