Skip to content

Commit ca5abe9

Browse files
committed
Code optimization on WriteDataType
Signed-off-by: José Simões <[email protected]>
1 parent e1d3aa0 commit ca5abe9

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

source/MetadataProcessor.Core/Tables/nanoSignaturesTable.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,10 @@ public void WriteDataType(
225225
bool expandEnumType,
226226
bool isTypeDefinition)
227227
{
228-
if (isTypeDefinition)
228+
if (isTypeDefinition &&
229+
typeDefinition.MetadataType == MetadataType.Object)
229230
{
230-
if (typeDefinition.MetadataType == MetadataType.Object)
231-
{
232-
writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_CLASS);
233-
return;
234-
}
235-
else
236-
{
237-
238-
}
239-
}
240-
241-
nanoCLR_DataType dataType;
242-
if (PrimitiveTypes.TryGetValue(typeDefinition.FullName, out dataType))
243-
{
244-
writer.WriteByte((byte)dataType);
231+
writer.WriteByte((byte)nanoCLR_DataType.DATATYPE_CLASS);
245232
return;
246233
}
247234

0 commit comments

Comments
 (0)