Skip to content

Instantly share code, notes, and snippets.

@zxsanny
zxsanny / LambdaEqualityComparer.cs
Last active July 17, 2020 15:14
Lambda Equality Comparer
public class EqualityComparerFactory
{
private sealed class Impl<T> : IEqualityComparer<T>
{
private readonly Func<T, T, bool> Eq;
private readonly Func<T, int> HashFunc;
public Impl(Func<T, T, bool> eq, Func<T, int> hashFunc)
{
Eq = eq;
HashFunc = hashFunc;