| 179 | }; |
| 180 | |
| 181 | static inline size_t CalcHashId(int Key) |
| 182 | { |
| 183 | // djb2 (http://www.cse.yorku.ca/~oz/hash.html) |
| 184 | unsigned Hash = 5381; |
| 185 | for(unsigned Shift = 0; Shift < sizeof(int); Shift++) |
| 186 | Hash = ((Hash << 5) + Hash) + ((Key >> (Shift * 8)) & 0xFF); |
| 187 | return Hash % HASHLIST_SIZE; |
| 188 | } |
| 189 | |
| 190 | static void GenerateHash(CItemList *pHashlist, const CSnapshot *pSnapshot) |
| 191 | { |
no outgoing calls
no test coverage detected