private LinkedListDictionary <K, V> BucketOf(K Key, LinkedListDictionary <K, V>[] Buckets)
        {
            int index = IndexOf(Key);

            if (Buckets[index] == null)
            {
                Buckets[index] = new LinkedListDictionary <K, V>();
            }
            return(Buckets[index]);
        }
        private void Resize()
        {
            if (Count < LOAD_FACTOR * _buckets.Length)
            {
                return;
            }

            var newBuckets = new LinkedListDictionary <K, V> [LOAD_FACTOR * _buckets.Length];

            foreach (K key in this)
            {
                V oldValue;
                InsertOrUpdate(key, this[key], out oldValue, newBuckets);
            }
            _buckets = newBuckets;
        }
Esempio n. 3
0
 public LinkedListDictionaryEnumerator(LinkedListDictionary <K, V> Iterable)
 {
     _iterable = Iterable;
     _iterator = Iterable._pairs.GetEnumerator();
 }