Esempio n. 1
0
 public HybridDictionary(int initialSize, bool checkExistingKeys)
 {
     _checkExistingKeys = checkExistingKeys;
     if (initialSize >= FixedSizeCutoverPoint)
     {
         _dictionary = new StringDictionarySlim <TValue>(initialSize);
     }
 }
Esempio n. 2
0
        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;
        }