mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-16 10:19:18 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
23 lines
489 B
C#
23 lines
489 B
C#
using System.Collections.Generic;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Sandbox
|
|
{
|
|
internal class ReferenceComparer : IEqualityComparer<object>
|
|
{
|
|
public static IEqualityComparer<object> Singleton { get; } = new ReferenceComparer();
|
|
|
|
private ReferenceComparer() { }
|
|
|
|
bool IEqualityComparer<object>.Equals( object x, object y )
|
|
{
|
|
return ReferenceEquals( x, y );
|
|
}
|
|
|
|
public int GetHashCode( object obj )
|
|
{
|
|
return RuntimeHelpers.GetHashCode( obj );
|
|
}
|
|
}
|
|
}
|