src/share/vm/utilities/hashtable.inline.hpp

changeset 2497
3582bf76420e
parent 2314
f95d63e2154a
child 2708
1d1603768966
equal deleted inserted replaced
2496:27e4ea99855d 2497:3582bf76420e
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 }

mercurial