It makes no difference if you're compiling using Release
mode (with optimize code enabled), which should be used for production environment. In both cases, the Intermediate Language
code generated by the compiler is described below.
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldc.i4.0
IL_0001: call object MetodosTeste.Program::FindExamById(int32)
IL_0006: pop
IL_0007: ret
} // end of method Program::Main
The pseudo-code used to generate IL
above was this:
class Program
{
static void Main(string[] args)
{
int id = 0;
//var exam = FindExamById(id);
if (FindExamById(id) == null)
return;
}
static object FindExamById(int id)
{
return int.MinValue;
}
}