Im trying to find the +=
in reflector
in order to see how they implemented :
a=+1
vs a=a+1
but I cant find it.
any help ?
There is no implemetation for the +=
operator anywhere, it's a pseudo operator that is handled by the compiler. The C# compiler expands a += 1
into a = a + 1
.
The JIT compiler then creates the most efficient code to do the a = a + 1
. If it's a simple variable it will just be an instruction that increases the value.