mirror of https://github.com/ogoun/Zero.git
14 lines
457 B
14 lines
457 B
namespace MemoryPools.Collections.Linq
|
|
{
|
|
public static partial class PoolingEnumerable
|
|
{
|
|
/// <summary>
|
|
/// Casts all elements to the given type. Complexity = O(N)
|
|
/// </summary>
|
|
public static IPoolingEnumerable<TR> Cast<TR>(this IPoolingEnumerable source)
|
|
{
|
|
if (source is IPoolingEnumerable<TR> res) return res;
|
|
return Pool<CastExprEnumerable<TR>>.Get().Init(source);
|
|
}
|
|
}
|
|
} |