| 138 | } |
| 139 | |
| 140 | void 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 |
nothing calls this directly
no test coverage detected