mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
968 B
24 lines
968 B
using System.Collections.Generic;
|
|
using MemoryPools.Collections.Specialized;
|
|
|
|
namespace MemoryPools.Collections.Linq
|
|
{
|
|
public static partial class PoolingEnumerable
|
|
{
|
|
public static IPoolingEnumerable<T> Except<T>(this IPoolingEnumerable<T> source, IPoolingEnumerable<T> except)
|
|
{
|
|
var exceptDict = Pool<PoolingDictionary<T, int>>.Get().Init(0);
|
|
foreach (var item in except) exceptDict[item] = 1;
|
|
|
|
return Pool<ExceptExprEnumerable<T>>.Get().Init(source, exceptDict);
|
|
}
|
|
|
|
public static IPoolingEnumerable<T> Except<T>(this IPoolingEnumerable<T> source, IPoolingEnumerable<T> except, IEqualityComparer<T> comparer)
|
|
{
|
|
var exceptDict = Pool<PoolingDictionary<T, int>>.Get().Init(0);
|
|
foreach (var item in except) exceptDict[item] = 1;
|
|
|
|
return Pool<ExceptExprEnumerable<T>>.Get().Init(source, exceptDict, comparer);
|
|
}
|
|
}
|
|
} |