Commit 65235cbb authored by Simon Skov Boisen's avatar Simon Skov Boisen

Remove unnecessary check for whether the type being deserialized is a ValueType

parent 885a8d46
...@@ -2265,13 +2265,6 @@ public static void SetTypeMap(Type type, ITypeMap map) ...@@ -2265,13 +2265,6 @@ public static void SetTypeMap(Type type, ITypeMap map)
types[i - startBound] = reader.GetFieldType(i); types[i - startBound] = reader.GetFieldType(i);
} }
if (type.IsValueType)
{
il.Emit(OpCodes.Ldloca_S, (byte)1);
il.Emit(OpCodes.Initobj, type);
}
else
{
var ctor = typeMap.FindConstructor(names, types); var ctor = typeMap.FindConstructor(names, types);
if (ctor == null) if (ctor == null)
{ {
...@@ -2287,7 +2280,6 @@ public static void SetTypeMap(Type type, ITypeMap map) ...@@ -2287,7 +2280,6 @@ public static void SetTypeMap(Type type, ITypeMap map)
else else
specializedConstructor = ctor; specializedConstructor = ctor;
} }
}
il.BeginExceptionBlock(); il.BeginExceptionBlock();
if (type.IsValueType) if (type.IsValueType)
......
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