18 lines
479 B
C#
18 lines
479 B
C#
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
namespace AlicizaX
|
||
|
|
{
|
||
|
|
internal sealed class ReferenceComparer<T> : IEqualityComparer<T>
|
||
|
|
where T : class
|
||
|
|
{
|
||
|
|
public static readonly ReferenceComparer<T> Instance = new ReferenceComparer<T>();
|
||
|
|
|
||
|
|
private ReferenceComparer() { }
|
||
|
|
|
||
|
|
public bool Equals(T x, T y) => ReferenceEquals(x, y);
|
||
|
|
|
||
|
|
public int GetHashCode(T obj)
|
||
|
|
=> System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(obj);
|
||
|
|
}
|
||
|
|
}
|