Weaver.ReadAllFields: remove unused field

This commit is contained in:
vis2k 2021-02-16 20:05:53 +08:00
parent bd34f100fc
commit 7e509eae4a

View File

@ -303,7 +303,6 @@ static void CreateNew(TypeReference variable, ILProcessor worker, TypeDefinition
static void ReadAllFields(TypeReference variable, ILProcessor worker)
{
uint fields = 0;
foreach (FieldDefinition field in variable.FindAllPublicFields())
{
// mismatched ldloca/ldloc for struct/class combinations is invalid IL, which causes crash at runtime
@ -322,7 +321,6 @@ static void ReadAllFields(TypeReference variable, ILProcessor worker)
FieldReference fieldRef = Weaver.CurrentAssembly.MainModule.ImportReference(field);
worker.Append(worker.Create(OpCodes.Stfld, fieldRef));
fields++;
}
}