MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / remove

Method remove

Engine/source/console/simDictionary.cpp:140–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void SimNameDictionary::remove(SimObject* obj)
141{
142 if(!obj || !obj->objectName)
143 return;
144
145 Mutex::lockMutex(mutex);
146#ifndef USE_NEW_SIMDICTIONARY
147 SimObject **walk = &hashTable[HashPointer(obj->objectName) % hashTableSize];
148 while(*walk)
149 {
150 if(*walk == obj)
151 {
152 *walk = obj->nextNameObject;
153 obj->nextNameObject = (SimObject*)-1;
154 hashEntryCount--;
155
156 Mutex::unlockMutex(mutex);
157 return;
158 }
159 walk = &((*walk)->nextNameObject);
160 }
161#else
162 const char* name = obj->objectName;
163 if (root.find(name) != root.end())
164 root.erase(name);
165#endif
166 Mutex::unlockMutex(mutex);
167}
168
169//----------------------------------------------------------------------------
170

Callers

nothing calls this directly

Calls 5

HashPointerFunction · 0.85
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected