public HybridDictionary(int initialSize, bool checkExistingKeys) { _checkExistingKeys = checkExistingKeys; if (initialSize >= FixedSizeCutoverPoint) { _dictionary = new StringDictionarySlim <TValue>(initialSize); } }
private void SwitchToDictionary(Key key, TValue value) { var dictionary = new StringDictionarySlim <TValue>(InitialDictionarySize); foreach (var pair in _list) { dictionary[pair.Key] = pair.Value; } dictionary[key] = value; _dictionary = dictionary; _list = null; }