modular-avatar/Runtime/Util/ObjectIdentityComparer.cs
bd_ 17e6c22335
fix: potential null reference exceptions from ProxyManager (#750)
* chore: fix incorrect namespace

* fix: potential null reference exceptions from ProxyManager
2024-03-09 18:08:38 +09:00

23 lines
467 B
C#

#region
using System.Collections.Generic;
using System.Runtime.CompilerServices;
#endregion
namespace nadena.dev.modular_avatar
{
internal class ObjectIdentityComparer<T> : IEqualityComparer<T>
{
public bool Equals(T x, T y)
{
return (object)x == (object)y;
}
public int GetHashCode(T obj)
{
if (obj == null) return 0;
return RuntimeHelpers.GetHashCode(obj);
}
}
}