object.ReferenceEquals()
CS-W1053ReferenceEquals()
method operates on object
s, also known as reference types. Passing value types to it causes them to be boxed. In such cases, the return value is always false
and unreliable. It is therefore recommended that you either rely on operators such as ==
and !=
or the object.Equals()
method.
var eq = object.ReferenceEquals(intA, intB);
var eq = intA == intB;