Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2010-04-20 17:06:09 +0400
committerjfrijters <jfrijters>2010-04-20 17:06:09 +0400
commite6d7e019413a9875644791e68cb7aad65c561247 (patch)
tree65d482c7b3b2004979873ed5db82d8a93890be27 /reflect/Util.cs
parent71b3df3913937d6955519efd110858d2b9581a27 (diff)
Made custom modifier packing more efficient and shared between MethodSignature and MethodBuilder.
Diffstat (limited to 'reflect/Util.cs')
-rw-r--r--reflect/Util.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/reflect/Util.cs b/reflect/Util.cs
index a27ed2ba..fe6d4341 100644
--- a/reflect/Util.cs
+++ b/reflect/Util.cs
@@ -129,6 +129,34 @@ namespace IKVM.Reflection
return false;
}
+ internal static bool ArrayEquals(Type[][][] t1, Type[][][] t2)
+ {
+ if (t1 == t2)
+ {
+ return true;
+ }
+ if (t1 == null)
+ {
+ return t2.Length == 0;
+ }
+ else if (t2 == null)
+ {
+ return t1.Length == 0;
+ }
+ if (t1.Length == t2.Length)
+ {
+ for (int i = 0; i < t1.Length; i++)
+ {
+ if (!ArrayEquals(t1[i], t2[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
internal static bool TypeEquals(Type t1, Type t2)
{
if (t1 == t2)
@@ -172,5 +200,18 @@ namespace IKVM.Reflection
}
return h;
}
+
+ internal static int GetHashCode(Type[][][] types)
+ {
+ int h = 0;
+ if (types != null)
+ {
+ foreach (Type[][] array in types)
+ {
+ h ^= GetHashCode(array);
+ }
+ }
+ return h;
+ }
}
}