更新时间:2022-05-22 08:53:24
如果你的意思是字段,然后没有。编译器注入本(的 ldarg.0 )您是否使用它明确(this.foo)或隐式(富)。
If you mean fields, then no. The compiler injects "this" (ldarg.0) whether you use it explicitly (this.foo) or implicitly (foo).
它,然而,拿5个字符你的源代码等开发硬盘的字节屈指可数。它将使编译IL或运行时恰好零差价
It does, however, take 5 more characters in your source code... so a handful of bytes on your development hard disk. It will make exactly zero difference in the compiled IL or at runtime.
有两种情况,其中使用这个变化的东西:
There are two scenarios where use of "this" changes things:
this.foo = foo的;
)的变量/参数 this.SomeMethod()
;)当this.foo = foo;
)this.SomeMethod()
;)