GetReadFunc: use actual types. less magic.

This commit is contained in:
vis2k 2019-01-15 23:32:20 +01:00
parent 2def424a8a
commit 7161126e67

View File

@ -267,14 +267,14 @@ public static MethodReference GetReadFunc(TypeReference variable)
{
if (lists.readFuncs.ContainsKey(variable.FullName))
{
var foundFunc = lists.readFuncs[variable.FullName];
MethodReference foundFunc = lists.readFuncs[variable.FullName];
if (foundFunc.ReturnType.IsArray == variable.IsArray)
{
return foundFunc;
}
}
var td = variable.Resolve();
TypeDefinition td = variable.Resolve();
if (td == null)
{
Log.Error("GetReadFunc unsupported type " + variable.FullName);
@ -292,8 +292,8 @@ public static MethodReference GetReadFunc(TypeReference variable)
if (variable.IsArray)
{
var elementType = variable.GetElementType();
var elementReadFunc = GetReadFunc(elementType);
TypeReference elementType = variable.GetElementType();
MethodReference elementReadFunc = GetReadFunc(elementType);
if (elementReadFunc == null)
{
return null;