ByReferenceKeyComparer.cs 395 B

123456789101112131415161718
  1. using System.Collections.Generic;
  2. using System.Runtime.CompilerServices;
  3. namespace ILRuntime.Other
  4. {
  5. class ByReferenceKeyComparer<T> : IEqualityComparer<T>
  6. {
  7. public bool Equals(T x, T y)
  8. {
  9. return object.ReferenceEquals(x, y);
  10. }
  11. public int GetHashCode(T obj)
  12. {
  13. return RuntimeHelpers.GetHashCode(obj);
  14. }
  15. }
  16. }