2022-09-22 08:56:07 +08:00
|
|
|
|
using dnlib.DotNet;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace HybridCLR.Editor
|
|
|
|
|
{
|
|
|
|
|
public static class EqualityUtil
|
|
|
|
|
{
|
2022-09-23 15:16:43 +08:00
|
|
|
|
public static bool EqualsTypeSig(TypeSig a, TypeSig b)
|
|
|
|
|
{
|
|
|
|
|
if (a == b)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (a != null && b != null)
|
|
|
|
|
{
|
|
|
|
|
return TypeEqualityComparer.Instance.Equals(a, b);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-22 08:56:07 +08:00
|
|
|
|
public static bool EqualsTypeSigArray(List<TypeSig> a, List<TypeSig> b)
|
|
|
|
|
{
|
|
|
|
|
if (a == b)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (a != null && b != null)
|
|
|
|
|
{
|
|
|
|
|
if (a.Count != b.Count)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < a.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (!TypeEqualityComparer.Instance.Equals(a[i], b[i]))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|