| 93 | } |
| 94 | |
| 95 | void InsertUnique(int hash, T value) |
| 96 | { |
| 97 | if (mHashHeads == NULL) |
| 98 | mHashHeads = (Entry**)mAlloc.AllocBytes(sizeof(Entry*) * HashSize, alignof(Entry*)); |
| 99 | |
| 100 | int hashIdx = hash % HashSize; |
| 101 | Entry* headEntry = mHashHeads[hashIdx]; |
| 102 | |
| 103 | Entry* checkEntry = headEntry; |
| 104 | while (checkEntry != NULL) |
| 105 | { |
| 106 | if (checkEntry->mValue == value) |
| 107 | return; |
| 108 | checkEntry = checkEntry->mNext; |
| 109 | } |
| 110 | |
| 111 | Entry* newEntry = mAlloc.Alloc<Entry>(); |
| 112 | newEntry->mValue = value; |
| 113 | newEntry->mNext = headEntry; |
| 114 | |
| 115 | mHashHeads[hashIdx] = newEntry; |
| 116 | } |
| 117 | |
| 118 | Entry* FindFirst(const char* name) |
| 119 | { |
nothing calls this directly
no test coverage detected