BOpenHashTable::Clear(): Set fItemCount to 0

If not empty, the count would afterwards be out of sync with reality.
This commit is contained in:
Ingo Weinhold 2013-04-18 15:52:57 +02:00
parent 5e6adff989
commit 7fa369956e
1 changed files with 2 additions and 1 deletions

View File

@ -230,7 +230,7 @@ public:
*/
ValueType* Clear(bool returnElements = false)
{
if (this->fItemCount == 0)
if (fItemCount == 0)
return NULL;
ValueType* result = NULL;
@ -256,6 +256,7 @@ public:
}
memset(this->fTable, 0, sizeof(ValueType*) * this->fTableSize);
fItemCount = 0;
return result;
}