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

Function InsertUnique

IDEHelper/StrBloomMap.h:95–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 1

AllocBytesMethod · 0.45

Tested by

no test coverage detected