| 188 | } |
| 189 | |
| 190 | static void GenerateHash(CItemList *pHashlist, const CSnapshot *pSnapshot) |
| 191 | { |
| 192 | for(int i = 0; i < HASHLIST_SIZE; i++) |
| 193 | pHashlist[i].m_Num = 0; |
| 194 | |
| 195 | for(int i = 0; i < pSnapshot->NumItems(); i++) |
| 196 | { |
| 197 | int Key = pSnapshot->GetItem(i)->Key(); |
| 198 | size_t HashId = CalcHashId(Key); |
| 199 | if(pHashlist[HashId].m_Num < HASHLIST_BUCKET_SIZE) |
| 200 | { |
| 201 | pHashlist[HashId].m_aIndex[pHashlist[HashId].m_Num] = i; |
| 202 | pHashlist[HashId].m_aKeys[pHashlist[HashId].m_Num] = Key; |
| 203 | pHashlist[HashId].m_Num++; |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | static int GetItemIndexHashed(int Key, const CItemList *pHashlist) |
| 209 | { |
no test coverage detected