Edward Ferron [mailto:[EMAIL PROTECTED]] wrote:

I don't know what you're seeing, but the IL emitted for each is exactly the
same (as expected).

<codeSnippet language="MSIL">
    .method private hidebysig instance void
            Test() cil managed
    {
      // Code size       28 (0x1c)
      .maxstack  2
      .locals init ([0] int32 i)
      IL_0000:  ldc.i4.0
      IL_0001:  stloc.0
      IL_0002:  br.s       IL_0013

      IL_0004:  ldloc.0
      IL_0005:  box        [mscorlib]System.Int32
      IL_000a:  call       void
[System]System.Diagnostics.Debug::WriteLine(object)
      IL_000f:  ldloc.0
      IL_0010:  ldc.i4.1
      IL_0011:  add
      IL_0012:  stloc.0
      IL_0013:  ldloc.0
      IL_0014:  ldc.i4     0x186a0
      IL_0019:  blt.s      IL_0004

      IL_001b:  ret
    } // end of method Form1::Test

    .method private hidebysig instance void
            Test2() cil managed
    {
      // Code size       28 (0x1c)
      .maxstack  2
      .locals init ([0] int32 i)
      IL_0000:  ldc.i4.0
      IL_0001:  stloc.0
      IL_0002:  br.s       IL_0013

      IL_0004:  ldloc.0
      IL_0005:  box        [mscorlib]System.Int32
      IL_000a:  call       void
[System]System.Diagnostics.Debug::WriteLine(object)
      IL_000f:  ldloc.0
      IL_0010:  ldc.i4.1
      IL_0011:  add
      IL_0012:  stloc.0
      IL_0013:  ldloc.0
      IL_0014:  ldc.i4     0x186a0
      IL_0019:  blt.s      IL_0004

      IL_001b:  ret
    } // end of method Form1::Test2
</codeSnippet>

Braces should have no effect on code and in this case, they most certainly
don't. Whatever you're seeing is some sort of anamoly.

HTH,
Drew

[ .NET MVP | weblog: http://radio.weblogs.com/0104813/ ]

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to