git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5812
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
private:
size_t m_count; // number of elements in the hashtable
private:
size_t m_count; // number of elements in the hashtable
hash_table = (wxList**) NULL;
Create(the_key_type, size);
m_count = 0;
hash_table = (wxList**) NULL;
Create(the_key_type, size);
m_count = 0;
+ m_deleteContents = FALSE;
/*
n = size;
current_position = -1;
/*
n = size;
current_position = -1;
int position = (int) (k % n);
if (!hash_table[position])
int position = (int) (k % n);
if (!hash_table[position])
hash_table[position] = new wxList (wxKEY_INTEGER);
hash_table[position] = new wxList (wxKEY_INTEGER);
+ if (m_deleteContents) hash_table[position]->DeleteContents(TRUE);
+ }
hash_table[position]->Append (value, object);
m_count++;
hash_table[position]->Append (value, object);
m_count++;
int position = (int) (k % n);
if (!hash_table[position])
int position = (int) (k % n);
if (!hash_table[position])
hash_table[position] = new wxList (wxKEY_INTEGER);
hash_table[position] = new wxList (wxKEY_INTEGER);
+ if (m_deleteContents) hash_table[position]->DeleteContents(TRUE);
+ }
hash_table[position]->Append (value, object);
m_count++;
hash_table[position]->Append (value, object);
m_count++;
int position = (int) (k % n);
if (!hash_table[position])
int position = (int) (k % n);
if (!hash_table[position])
hash_table[position] = new wxList (wxKEY_INTEGER);
hash_table[position] = new wxList (wxKEY_INTEGER);
+ if (m_deleteContents) hash_table[position]->DeleteContents(TRUE);
+ }
+
hash_table[position]->Append (k, object);
m_count++;
}
hash_table[position]->Append (k, object);
m_count++;
}
int position = (int) (MakeKey (key) % n);
if (!hash_table[position])
int position = (int) (MakeKey (key) % n);
if (!hash_table[position])
hash_table[position] = new wxList (wxKEY_STRING);
hash_table[position] = new wxList (wxKEY_STRING);
+ if (m_deleteContents) hash_table[position]->DeleteContents(TRUE);
+ }
hash_table[position]->Append (key, object);
m_count++;
hash_table[position]->Append (key, object);
m_count++;
void wxHashTable::DeleteContents (bool flag)
{
int i;
void wxHashTable::DeleteContents (bool flag)
{
int i;
+ m_deleteContents = flag;
for (i = 0; i < n; i++)
{
if (hash_table[i])
for (i = 0; i < n; i++)
{
if (hash_table[i])