I searched the source code of FCL, and I got confused that string.Equals()
uses Object.ReferenceEquals()
, and Object.ReferenceEquals()
use
ceq takes two values from the stack and gives results. If the result value is 1 then they are considered equal and 0 if they are not equal.
However, the ==
operator doesn't always get translated to ceq
.
Whether ==
in C# results in ceq
depends on some more factors like are data types primitives
or do they have custom == operators
or are they references
.