Keep order of nodes when wxHashMap is resized; this ensures

that wxHashTable has the same behaviour when wxUSE_STL=1 as
when wxUSE_STL=0.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-08-20 16:59:17 +00:00
parent 6f2ec3c3de
commit 8ae94823a3
3 changed files with 34 additions and 6 deletions

View File

@@ -70,6 +70,7 @@ protected:
static void CopyHashTable( _wxHashTable_NodeBase** srcTable,
size_t srcBuckets, _wxHashTableBase2* dst,
_wxHashTable_NodeBase** dstTable,
size_t dstBuckets,
BucketFromNode func, ProcessNode proc );
static void** AllocTable( size_t sz )
@@ -357,7 +358,7 @@ protected: \
m_tableBuckets = newSize; \
\
CopyHashTable( (_wxHashTable_NodeBase**)srcTable, srcBuckets, \
this, (_wxHashTable_NodeBase**)m_table, \
this, (_wxHashTable_NodeBase**)m_table, newSize, \
(BucketFromNode)GetBucketForNode,\
(ProcessNode)&DummyProcessNode ); \
free(srcTable); \
@@ -369,7 +370,7 @@ protected: \
ResizeTable( ht.size() ); \
CopyHashTable( (_wxHashTable_NodeBase**)ht.m_table, ht.m_tableBuckets,\
(_wxHashTableBase2*)this, \
(_wxHashTable_NodeBase**)m_table, \
(_wxHashTable_NodeBase**)m_table, m_tableBuckets, \
(BucketFromNode)GetBucketForNode, \
(ProcessNode)CopyNode ); \
} \