| 110 | static int gCurFreeId; |
| 111 | |
| 112 | int 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 | |
| 130 | BfParseFileData::~BfParseFileData() |
| 131 | { |
no test coverage detected