| 222 | } |
| 223 | } |
| 224 | void Add(int hash,int value) |
| 225 | { |
| 226 | assert(hash>=0&&hash<MAX_HASH); |
| 227 | assert(value); // 0 is the empty marker |
| 228 | int i=hash; |
| 229 | while (mHashes[i]) |
| 230 | { |
| 231 | assert(mHashes[i]!=value); //please don't insert things twice |
| 232 | i=(i+1)&(MAX_HASH-1); |
| 233 | assert(i!=hash); //hash table is full? |
| 234 | } |
| 235 | mHashes[i]=value; |
| 236 | } |
| 237 | int FindFirst(int hash) |
| 238 | { |
| 239 | mFindPtr=hash; |