09/06/07 22:30:27
>>157 >>171
スレが荒れているので聞き流されるかもしれないが、C#のコンパイラはあまり最適化などかけず、
かなり素直なコードを吐き出すんだが、それを知っているんだろうか。
public void SampleMethod1()
{
this.textBox1.Text = "1";
this.textBox2.Text = "1あ";
}
public void SampleMethod2()
{
string s = "1";
this.textBox1.Text = s;
this.textBox2.Text = s + "あ";
}
最初の質問の例を一旦コンパイルした後、ディスアセンブルするとこんな感じになる。
ほとんど最適化されてない。