private void CheckResize() { if (length / size < 0.5) { return; } MyHashTable <TKey, TValue> table = new MyHashTable <TKey, TValue>(FindNextPrime(size)); foreach (KeyValuePair <TKey, TValue> pair in this) { table.Add(pair); } baseArray = table.baseArray; size = table.size; }