Skip to content

Commit 24f35bc

Browse files
authored
Update ReferenceEqualityComparer.cs (#24728)
We don't support running on mono 4.x anymore
1 parent 369b8a1 commit 24f35bc

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/Mvc/Mvc.Core/src/ModelBinding/ReferenceEqualityComparer.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
99
{
1010
internal class ReferenceEqualityComparer : IEqualityComparer<object>
1111
{
12-
private static readonly bool IsMono = Type.GetType("Mono.Runtime") != null;
13-
1412
public static ReferenceEqualityComparer Instance { get; } = new ReferenceEqualityComparer();
1513

1614
public new bool Equals(object x, object y)
@@ -20,14 +18,6 @@ internal class ReferenceEqualityComparer : IEqualityComparer<object>
2018

2119
public int GetHashCode(object obj)
2220
{
23-
// RuntimeHelpers.GetHashCode sometimes crashes the runtime on Mono 4.0.4
24-
// See: https://github.com/aspnet/External/issues/45
25-
// The workaround here is to just not hash anything, and fall back to an equality check.
26-
if (IsMono)
27-
{
28-
return 0;
29-
}
30-
3121
return RuntimeHelpers.GetHashCode(obj);
3222
}
3323
}

0 commit comments

Comments
 (0)