For a simple Method with no local variables like the following
public static int Test1(short i, long j)
{
j = i + j;
switch (j)
{
case 1:
j = 2;
break;
default:
j = 11;
break;
}
return j;
}
The count of MethodInfo.GetMethodBody().LocalVariables.Count = 2 WHY? Add another switch statement and the count becomes 3 WHY?
public static int Test1(short i, long j)
{
j = i + j;
switch (j)
{
case 1:
j = 2;
break;
default:
j = 11;
break;
}
switch (i)
{
case 1:
j = 2;
break;
default:
j = 11;
break;
}
return j;
}
No local variables are defined. So why 2 and 3. Also if another switch statement with j keeps the count at 2.