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

Method GetUniqueId

IDEHelper/Compiler/BfParser.cpp:112–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110static int gCurFreeId;
111
112int BfParseFileData::GetUniqueId(int idx)
113{
114 AutoCrit autoCrit(gParseFileDataCrit);
115
116 int* valuePtr = NULL;
117 if (mUniqueIDList.TryAdd(idx, NULL, &valuePtr))
118 {
119 if (!gFreeIds.IsEmpty())
120 {
121 *valuePtr = gFreeIds.back();
122 gFreeIds.pop_back();
123 }
124 else
125 *valuePtr = gCurFreeId++;
126 }
127 return *valuePtr;
128}
129
130BfParseFileData::~BfParseFileData()
131{

Callers 1

InitAnonymousTypeMethod · 0.80

Calls 4

TryAddMethod · 0.45
IsEmptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected