Commit 83bcfefb authored by Ruben Garat's avatar Ruben Garat

added concrete IEqualityComparer<ExtensionIntPair> implementation in…

added concrete IEqualityComparer<ExtensionIntPair> implementation in ExtensionRegistryLite.cs to prevent AOT compilation issue with unity in iOS
parent a526605a
...@@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers ...@@ -96,7 +96,7 @@ namespace Google.ProtocolBuffers
{ {
private static readonly ExtensionRegistry empty = new ExtensionRegistry( private static readonly ExtensionRegistry empty = new ExtensionRegistry(
new ExtensionByNameMap(), new ExtensionByNameMap(),
new ExtensionByIdMap(), new ExtensionByIdMap(new ExtensionIntPairEqualityComparer()),
true); true);
private readonly ExtensionByNameMap extensionsByName; private readonly ExtensionByNameMap extensionsByName;
...@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers ...@@ -116,7 +116,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
public static ExtensionRegistry CreateInstance() 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() public ExtensionRegistry AsReadOnly()
...@@ -216,5 +216,17 @@ namespace Google.ProtocolBuffers ...@@ -216,5 +216,17 @@ namespace Google.ProtocolBuffers
return msgType.Equals(other.msgType) && number == other.number; 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment