Skip to content

Commit

Permalink
Change: drop deserialized value -> reader.Skip()
Browse files Browse the repository at this point in the history
  • Loading branch information
pCYSl5EDgo committed Oct 26, 2020
1 parent 9b0d4a2 commit d84ae75
Showing 1 changed file with 16 additions and 12 deletions.
Expand Up @@ -44,28 +44,32 @@ private static bool IsConstructorParameter(ObjectSerializationInfo objectSeriali

private static void Assign(StringBuilder buffer, in MemberInfoTuple member, bool canOverwrite, string indent, string tab, int tabCount)
{
if (canOverwrite)
if (member.Info.IsWritable)
{
if (member.Info.IsWritable)
if (canOverwrite)
{
buffer.Append("____result.").Append(member.Info.Name).Append(" = ");
}
}
else
{
if (!member.IsConstructorParameter)
else
{
buffer.Append("__").Append(member.Info.Name).Append("__IsInitialized = true;\r\n").Append(indent);
for (var i = 0; i < tabCount; i++)
if (!member.IsConstructorParameter)
{
buffer.Append(tab);
buffer.Append("__").Append(member.Info.Name).Append("__IsInitialized = true;\r\n").Append(indent);
for (var i = 0; i < tabCount; i++)
{
buffer.Append(tab);
}
}

buffer.Append("__").Append(member.Info.Name).Append("__ = ");
}

buffer.Append("__").Append(member.Info.Name).Append("__ = ");
buffer.Append(member.Info.GetDeserializeMethodString()).Append(";\r\n");
}
else
{
buffer.Append("reader.Skip();\r\n");
}

buffer.Append(member.Info.GetDeserializeMethodString()).Append(";\r\n");
}

private static void ClassifyRecursion(StringBuilder buffer, string indent, int tabCount, int keyLength, IEnumerable<MemberInfoTuple> memberCollection, bool canOverwrite)
Expand Down

0 comments on commit d84ae75

Please sign in to comment.