* Handle matching null binder
* Early out HashMap::Rehash()
{
LIMITED_METHOD_CONTRACT;
- BOOL fIsSameInstance = FALSE;
+ BOOL fIsSameInstance = (pBinderA == pBinderB);
- if ((pBinderA != NULL) && (pBinderB != NULL))
+ if (!fIsSameInstance && (pBinderA != NULL) && (pBinderB != NULL))
{
// Get the ID for the first binder
UINT_PTR binderIDA = 0, binderIDB = 0;
_ASSERTE (OwnLock());
#endif
- DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex = NewSize()];
+ UPTR newPrimeIndex = NewSize();
- ASSERT(m_iPrimeIndex < 70);
+ ASSERT(newPrimeIndex < g_rgNumPrimes);
+
+ if ((m_iPrimeIndex == newPrimeIndex) && (m_cbDeletes == 0))
+ {
+ return;
+ }
+
+ m_iPrimeIndex = newPrimeIndex;
+
+ DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex];
Bucket* rgBuckets = Buckets();
UPTR cbCurrSize = GetSize(rgBuckets);