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

Method AddRaw

BeefySysLib/util/MultiHashSet.h:277–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 }
276
277 EntryRef AddRaw(int hash)
278 {
279 if (this->mHashHeads == NULL)
280 {
281 this->mHashHeads = TFuncs::template allocate<int>(mHashSize);
282 memset(this->mHashHeads, -1, sizeof(int) * mHashSize);
283 }
284
285 int index = AllocEntry();
286 int hashIdx = (hash & 0x7FFFFFFF) % this->mHashSize;
287 int headEntry = this->mHashHeads[hashIdx];
288
289 Entry* newEntry = &mEntries[index];
290 newEntry->mValue = T();
291 newEntry->mNext = headEntry;
292 newEntry->mHashCode = hash;
293
294 mHashHeads[hashIdx] = index;
295
296 return EntryRef(this, index);
297 }
298
299 void Add(T value)
300 {

Callers

nothing calls this directly

Calls 1

EntryRefClass · 0.70

Tested by

no test coverage detected