Skip to content

Commit

Permalink
Use the short form of an opcode in ILGenerator.EmitWriteLine. (#59836)
Browse files Browse the repository at this point in the history
`ILGenerator.Emit(short)` does not use short forms if applicable; only the int overload does, but here we can directly use `ldarg.0`.
  • Loading branch information
teo-tsirpanis authored Oct 1, 2021
1 parent 900a0d6 commit 4ddd11d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ public virtual void EmitWriteLine(FieldInfo fld)
}
else
{
Emit(OpCodes.Ldarg, (short)0); // Load the this ref.
Emit(OpCodes.Ldarg_0); // Load the this ref.
Emit(OpCodes.Ldfld, fld);
}
Type[] parameterTypes = new Type[1];
Expand Down

0 comments on commit 4ddd11d

Please sign in to comment.