| Previous | 199869 Revisions | Next |
| r20039 Thursday 3rd January, 2013 at 14:22:27 UTC by O. Galibert |
|---|
| tagmap: Try a slightly better hashing function [O. Galibert] |
| [src/lib/util] | tagmap.h |
| r20038 | r20039 | |
|---|---|---|
| 114 | 114 | UINT32 hash(const char *string) const |
| 115 | 115 | { |
| 116 | 116 | UINT32 result = *string++; |
| 117 | for (char c = *string++; c != 0; c = *string++) | |
| 118 | result = ((result << 5) | (result >> 27)) + c; | |
| 117 | for (UINT8 c = *string++; c != 0; c = *string++) | |
| 118 | result = (result*33) ^ c; | |
| 119 | 119 | return result; |
| 120 | 120 | } |
| 121 | 121 |
| Previous | 199869 Revisions | Next |