… | |
… | |
19 | struct str_hash |
19 | struct str_hash |
20 | { |
20 | { |
21 | std::size_t operator ()(const char *s) const |
21 | std::size_t operator ()(const char *s) const |
22 | { |
22 | { |
23 | unsigned long hash = 0; |
23 | unsigned long hash = 0; |
24 | unsigned int i = 0; |
|
|
25 | |
24 | |
26 | /* use the one-at-a-time hash function, which supposedly is |
25 | /* use the one-at-a-time hash function, which supposedly is |
27 | * better than the djb2-like one used by perl5.005, but |
26 | * better than the djb2-like one used by perl5.005, but |
28 | * certainly is better then the bug used here before. |
27 | * certainly is better then the bug used here before. |
29 | * see http://burtleburtle.net/bob/hash/doobs.html |
28 | * see http://burtleburtle.net/bob/hash/doobs.html |