public static TempDictionary <TKey, TValue> GetDict(IDictionary <TKey, TValue> dict) { TempDictionary <TKey, TValue> result; if (_pool.TryGetInstance(out result)) { var le = LightEnumerator.Create(dict); while (le.MoveNext()) { result.Add(le.Current.Key, le.Current.Value); } } else { result = new TempDictionary <TKey, TValue>(dict); } return(result); }
public static TempDictionary <TKey, TValue> GetDict <TKey, TValue>(IDictionary <TKey, TValue> dict) { return(TempDictionary <TKey, TValue> .GetDict(dict)); }