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

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbevain <jbevain@gmail.com>2010-07-24 20:14:17 +0400
committerjbevain <jbevain@gmail.com>2010-07-24 20:14:17 +0400
commit95cedf2997500d4cbb9ea1300ebd5f070d94d45b (patch)
tree2c2fc7073de850aa6894ff4dd663ad4e5ba2a14e /Mono.Cecil.Metadata
parent89cc5ef95b971a81e6bf133e4726c7aaa3f5c191 (diff)
fix readonly build
Diffstat (limited to 'Mono.Cecil.Metadata')
-rw-r--r--Mono.Cecil.Metadata/Row.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/Mono.Cecil.Metadata/Row.cs b/Mono.Cecil.Metadata/Row.cs
index 024bc67..ab491a6 100644
--- a/Mono.Cecil.Metadata/Row.cs
+++ b/Mono.Cecil.Metadata/Row.cs
@@ -26,6 +26,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Collections.Generic;
+
namespace Mono.Cecil.Metadata {
struct Row<T1, T2> {
@@ -127,4 +129,42 @@ namespace Mono.Cecil.Metadata {
Col9 = col9;
}
}
+
+ sealed class RowEqualityComparer : IEqualityComparer<Row<string, string>>, IEqualityComparer<Row<uint, uint>>, IEqualityComparer<Row<uint, uint, uint>> {
+
+ public bool Equals (Row<string, string> x, Row<string, string> y)
+ {
+ return x.Col1 == y.Col1
+ && x.Col2 == y.Col2;
+ }
+
+ public int GetHashCode (Row<string, string> obj)
+ {
+ string x = obj.Col1, y = obj.Col2;
+ return (x != null ? x.GetHashCode () : 0) ^ (y != null ? y.GetHashCode () : 0);
+ }
+
+ public bool Equals (Row<uint, uint> x, Row<uint, uint> y)
+ {
+ return x.Col1 == y.Col1
+ && x.Col2 == y.Col2;
+ }
+
+ public int GetHashCode (Row<uint, uint> obj)
+ {
+ return (int) (obj.Col1 ^ obj.Col2);
+ }
+
+ public bool Equals (Row<uint, uint, uint> x, Row<uint, uint, uint> y)
+ {
+ return x.Col1 == y.Col1
+ && x.Col2 == y.Col2
+ && x.Col3 == y.Col3;
+ }
+
+ public int GetHashCode (Row<uint, uint, uint> obj)
+ {
+ return (int) (obj.Col1 ^ obj.Col2 ^ obj.Col3);
+ }
+ }
}