using MemoryPools.Collections.Linq;
using System.Collections.Generic;
/*https://github.com/sidristij/memory-pools/blob/master/MemoryPools.Collections*/
namespace MemoryPools.Collections
{
public interface IPoolingEnumerable
{
// Returns an enumerator that iterates through the collection.
/// An enumerator that can be used to iterate through the collection.
IPoolingEnumerator GetEnumerator();
}
public static partial class EnumerableEx
{
public static IPoolingEnumerable AsPooling(this IEnumerable source)
{
return Pool>.Get().Init(source);
}
public static IEnumerable AsEnumerable(this IPoolingEnumerable source)
{
return Pool>.Get().Init(source);
}
}
}