Minecraft-Phantom-Panel/Utils/Phantom.Utils/Collections/ReferenceEqualityComparer.cs

16 lines
378 B
C#

using System.Runtime.CompilerServices;
namespace Phantom.Utils.Collections;
public sealed class ReferenceEqualityComparer<T> : IEqualityComparer<T> {
public static readonly ReferenceEqualityComparer<T> Instance = new ();
public bool Equals(T? x, T? y) {
return ReferenceEquals(x, y);
}
public int GetHashCode(T obj) {
return RuntimeHelpers.GetHashCode(obj);
}
}