BOpenHashTable::Clear(): Set fItemCount to 0
If not empty, the count would afterwards be out of sync with reality.
This commit is contained in:
@@ -230,7 +230,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ValueType* Clear(bool returnElements = false)
|
ValueType* Clear(bool returnElements = false)
|
||||||
{
|
{
|
||||||
if (this->fItemCount == 0)
|
if (fItemCount == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ValueType* result = NULL;
|
ValueType* result = NULL;
|
||||||
@@ -256,6 +256,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(this->fTable, 0, sizeof(ValueType*) * this->fTableSize);
|
memset(this->fTable, 0, sizeof(ValueType*) * this->fTableSize);
|
||||||
|
fItemCount = 0;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user