MCPcopy Create free account
hub / github.com/beefytech/Beef / Find

Function Find

IDEHelper/StrHashMap.h:156–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

FindMethod · 0.85

Calls 2

RehashFunction · 0.85
StrEqualFunction · 0.85

Tested by

no test coverage detected