Пример #1
0
    public static RecycleList <T> MakeValueEnumerable <TStructEnumerable>(ref TStructEnumerable enumerable) where TStructEnumerable : struct, IEnumerable <T>
    {
        RecycleList <T> list = RecycleList <T> .Make();

        list.AddRange((TStructEnumerable)enumerable);
        return(list);
    }
Пример #2
0
    public static RecycleList <T> Make <TClassEnumerable>(TClassEnumerable enumerable) where TClassEnumerable : class, IEnumerable <T>
    {
        RecycleList <T> list = RecycleList <T> .Make();

        list.AddRange(enumerable);
        return(list);
    }
Пример #3
0
    public static RecycleList <T> MakeFromValuedEnumerator <TEnumerator>(ref TEnumerator enumerator) where TEnumerator : struct, IEnumerator <T>
    {
        RecycleList <T> list = RecycleList <T> .Make();

        while (enumerator.MoveNext())
        {
            list.Add((T)enumerator.Current);
        }
        enumerator.Dispose();
        return(list);
    }
Пример #4
0
 public RecycleList <T> Clone()
 {
     return(RecycleList <T> .Make <RecycleList <T> >(this));
 }