modular-avatar/Runtime/Util/ObjectIdentityComparer.cs

23 lines
467 B
C#
Raw Normal View History

#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);
}
}
}