예제 #1
0
        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]);
        }
예제 #2
0
        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;
        }
예제 #3
0
 public LinkedListDictionaryEnumerator(LinkedListDictionary <K, V> Iterable)
 {
     _iterable = Iterable;
     _iterator = Iterable._pairs.GetEnumerator();
 }