mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-02-08 14:52:49 +08:00
19 lines
479 B
C#
19 lines
479 B
C#
|
using System.Collections.Generic;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
|
|||
|
namespace nadena.dev.modular_avatar.JacksonDunstan.NativeCollections
|
|||
|
{
|
|||
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|