示例#1
0
 internal Enumerator(DictionaryULong <TValue> dictionary)
 {
     this.dictionary   = dictionary;
     this.version      = dictionary.version;
     this.index        = 0;
     this.currentValue = default(TValue);
 }
示例#2
0
        public static void Copy <T, TCopy>(DictionaryULong <T> fromDic, ref DictionaryULong <T> dic, TCopy copy) where TCopy : IArrayElementCopy <T>
        {
            if (fromDic == null)
            {
                if (dic != null)
                {
                    foreach (var kv in dic)
                    {
                        copy.Recycle(kv.Value);
                    }

                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = null;
                return;
            }

            if (dic == null || fromDic.Count != dic.Count)
            {
                if (dic != null)
                {
                    foreach (var kv in dic)
                    {
                        copy.Recycle(kv.Value);
                    }

                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = PoolDictionaryULong <T> .Spawn(fromDic.Count);
            }

            dic.CopyFrom(fromDic, copy);
        }
示例#3
0
        public static void Copy <T>(DictionaryULong <T> fromDic, ref DictionaryULong <T> dic)
        {
            if (fromDic == null)
            {
                if (dic != null)
                {
                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = null;
                return;
            }

            if (dic == null || fromDic.Count != dic.Count)
            {
                if (dic != null)
                {
                    PoolDictionaryULong <T> .Recycle(ref dic);
                }

                dic = PoolDictionaryULong <T> .Spawn(fromDic.Count);
            }

            dic.CopyFrom(fromDic);
        }
示例#4
0
 public KeyCollection(DictionaryULong <TValue> dictionary)
 {
     if (dictionary == null)
     {
         ThrowHelper.ThrowArgumentNullException(ExceptionArgument.dictionary);
     }
     this.dictionary = dictionary;
 }
示例#5
0
 internal Enumerator(DictionaryULong <TValue> dictionary, int getEnumeratorRetType)
 {
     this.dictionary           = dictionary;
     this.version              = dictionary.version;
     this.index                = 0;
     this.getEnumeratorRetType = getEnumeratorRetType;
     this.current              = new KeyValuePair <TKey, TValue>();
 }
示例#6
0
 public static void Recycle(ref DictionaryULong <TValue> dic)
 {
     Pools.current.PoolRecycle(ref dic);
 }