deleteVariables() assumes remove() is a stable remove (will not reorder entries on remove)
| 353 | |
| 354 | // deleteVariables() assumes remove() is a stable remove (will not reorder entries on remove) |
| 355 | void Dictionary::remove(Dictionary::Entry *ent) |
| 356 | { |
| 357 | Entry **walk = &hashTable->data[HashPointer(ent->name) % hashTable->size]; |
| 358 | while (*walk != ent) |
| 359 | walk = &((*walk)->nextEntry); |
| 360 | |
| 361 | #ifdef DEBUG_SPEW |
| 362 | Platform::outputDebugString("[ConsoleInternal] Removing entry '%s'", ent->name); |
| 363 | #endif |
| 364 | |
| 365 | *walk = (ent->nextEntry); |
| 366 | |
| 367 | destructInPlace(ent); |
| 368 | hashTable->mChunker.free(ent); |
| 369 | |
| 370 | hashTable->count--; |
| 371 | } |
| 372 | |
| 373 | Dictionary::Dictionary() |
| 374 | : hashTable(NULL), |
no test coverage detected