diff options
author | jfrijters <jfrijters> | 2010-04-20 17:06:09 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2010-04-20 17:06:09 +0400 |
commit | e6d7e019413a9875644791e68cb7aad65c561247 (patch) | |
tree | 65d482c7b3b2004979873ed5db82d8a93890be27 /reflect/Util.cs | |
parent | 71b3df3913937d6955519efd110858d2b9581a27 (diff) |
Made custom modifier packing more efficient and shared between MethodSignature and MethodBuilder.
Diffstat (limited to 'reflect/Util.cs')
-rw-r--r-- | reflect/Util.cs | 41 |
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; + } } } |