deleteVariables() assumes remove() is a stable remove (will not reorder entries on remove)
| 339 | |
| 340 | // deleteVariables() assumes remove() is a stable remove (will not reorder entries on remove) |
| 341 | void Dictionary::remove(Dictionary::Entry *ent) |
| 342 | { |
| 343 | Entry **walk = &hashTable->data[HashPointer(ent->name) % hashTable->size]; |
| 344 | while(*walk != ent) |
| 345 | walk = &((*walk)->nextEntry); |
| 346 | |
| 347 | #ifdef DEBUG_SPEW |
| 348 | Platform::outputDebugString( "[ConsoleInternal] Removing entry '%s'", ent->name ); |
| 349 | #endif |
| 350 | |
| 351 | *walk = (ent->nextEntry); |
| 352 | |
| 353 | destructInPlace( ent ); |
| 354 | hashTable->mChunker.free( ent ); |
| 355 | |
| 356 | hashTable->count--; |
| 357 | } |
| 358 | |
| 359 | Dictionary::Dictionary() |
| 360 | : hashTable( NULL ), |
no test coverage detected