com.alicizax.unity.framework/Runtime/ABase/Service/Core/ReferenceComparer.cs

18 lines
479 B
C#
Raw Permalink Normal View History

2026-03-26 10:49:41 +08:00
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);
}
}