| 154 | } |
| 155 | |
| 156 | Entry* Find(const char* name) |
| 157 | { |
| 158 | if (mHashHeads == NULL) |
| 159 | return NULL; |
| 160 | |
| 161 | // Make the lookup load reasonable |
| 162 | if (mHashSize < mCount / 2) |
| 163 | { |
| 164 | Rehash(mCount / 2 + 123); |
| 165 | } |
| 166 | |
| 167 | int hash = GetHash(name); |
| 168 | int hashIdx = hash % mHashSize; |
| 169 | Entry* checkEntry = mHashHeads[hashIdx]; |
| 170 | while (checkEntry != NULL) |
| 171 | { |
| 172 | if ((checkEntry->mHash == hash) && (StrEqual(name, checkEntry->mValue->mName))) |
| 173 | return checkEntry; |
| 174 | checkEntry = checkEntry->mNext; |
| 175 | } |
| 176 | return NULL; |
| 177 | } |
| 178 | |
| 179 | void Clear() |
| 180 | { |