using System.Collections.Generic; using System.Runtime.CompilerServices; namespace LeanCloud.Storage.Internal { /// /// An equality comparer that uses the object identity (i.e. ReferenceEquals) /// rather than .Equals, allowing identity to be used for checking equality in /// ISets and IDictionaries. /// public class IdentityEqualityComparer : IEqualityComparer { public bool Equals(T x, T y) { return object.ReferenceEquals(x, y); } public int GetHashCode(T obj) { return RuntimeHelpers.GetHashCode(obj); } } }