using MemoryPools.Collections.Specialized;
namespace MemoryPools.Collections.Linq
{
public static partial class PoolingEnumerable
{
///
/// Returns sequence with backward direction. Complexity = 2 * O(N) (collect + return)
///
public static IPoolingEnumerable Reverse(this IPoolingEnumerable source)
{
var list = Pool>.Get().Init();
foreach (var item in source)
{
list.Add(item);
}
return Pool>.Get().Init(list);
}
}
}