MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / Clear

Method Clear

src/core/hashtable.h:470–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468////////////////////////////////////////////////////////////////////////////////
469template<class KEY_TYPE, class VAL_TYPE, class COMPARE_OP, class CONVERTER>
470bool cHashTable<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::Clear(void)
471{
472 for (int i = 0; i < mTableSize; ++i)
473 {
474 if (mTable[i] != NULL)
475 {
476 node* curr = mTable[i];
477 node* del;
478 while (curr != NULL)
479 {
480 del = curr;
481 curr = curr->next;
482 delete del;
483 if (del == mTable[i])
484 mTable[i] = NULL;
485 del = NULL;
486
487 } //end delete chain loop
488 } //end if mTable[i]!= NULL
489 } //end for
490 return (IsEmpty());
491}
492
493////////////////////////////////////////////////////////////////////////////////
494// IsEmpty --

Callers 1

InitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected