diff options
author | Ruben Garat <ruben@ironhidegames.com> | 2015-05-15 16:06:59 -0300 |
---|---|---|
committer | Ruben Garat <ruben@ironhidegames.com> | 2015-05-20 18:07:09 -0300 |
commit | 83bcfefb0be8a2a05a03e7d7080b354973c39b20 (patch) | |
tree | 67bfc96ff28b025e2a787ca2789305b94614630e /csharp/src | |
parent | a526605aec4358e948bde0a8ad63f5f1de6f2cb5 (diff) | |
download | protobuf-83bcfefb0be8a2a05a03e7d7080b354973c39b20.tar.gz protobuf-83bcfefb0be8a2a05a03e7d7080b354973c39b20.tar.bz2 protobuf-83bcfefb0be8a2a05a03e7d7080b354973c39b20.zip |
added concrete IEqualityComparer<ExtensionIntPair> implementation in ExtensionRegistryLite.cs to prevent AOT compilation issue with unity in iOS
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs b/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs index d1220e9c..cc4a50bb 100644 --- a/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs +++ b/csharp/src/ProtocolBuffers/ExtensionRegistryLite.cs @@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers {
private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new ExtensionByNameMap(),
- new ExtensionByIdMap(),
+ new ExtensionByIdMap(new ExtensionIntPairEqualityComparer()),
true);
private readonly ExtensionByNameMap extensionsByName;
@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers /// </summary>
public static ExtensionRegistry CreateInstance()
{
- return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(), false);
+ return new ExtensionRegistry(new ExtensionByNameMap(), new ExtensionByIdMap(new ExtensionIntPairEqualityComparer()), false);
}
public ExtensionRegistry AsReadOnly()
@@ -216,5 +216,17 @@ namespace Google.ProtocolBuffers return msgType.Equals(other.msgType) && number == other.number;
}
}
+
+ internal class ExtensionIntPairEqualityComparer : IEqualityComparer<ExtensionIntPair>
+ {
+ public bool Equals(ExtensionIntPair x, ExtensionIntPair y)
+ {
+ return x.Equals(y);
+ }
+ public int GetHashCode(ExtensionIntPair obj)
+ {
+ return obj.GetHashCode();
+ }
+ }
}
-}
\ No newline at end of file +}
|