Will using 'var' affect performance?

后端 未结 12 1646
南方客
南方客 2020-11-22 14:01

Earlier I asked a question about why I see so many examples use the varkeyword and got the answer that while it is only necessary for anonymous types, that it is used noneth

12条回答
  •  感动是毒
    2020-11-22 14:49

    The C# compiler infers the true type of the var variable at compile time. There's no difference in the generated IL.

提交回复
热议问题