Exemplo n.º 1
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public CDictionary <TKey, TValue> Clone()
        {
            int count = this.count;
            CDictionary <TKey, TValue> res = new CDictionary <TKey, TValue>(this.Count, comparer);

            Entry[] entries = this.entries;
            for (int i = 0; i < count; i++)
            {
                if (entries[i].hashCode >= 0)
                {
                    res.Add(entries[i].key, entries[i].value);
                }
            }
            return(res);
        }