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