I don't understand why Resharper suggest me to "check for reference equality instead" in this code:
if ( typeToTranslate.Equals( typeof(string) ) )
{
//do something
}
Why this should be better:
typeToTranslate == typeof(string)
------------EDIT------------
This is the method stub:
protected IType TranslateType(Type typeToTranslate)
{
if (typeToTranslate == null) throw new ArgumentNullException("typeToTranslate");
//do some stuff
if (typeToTranslate.Equals(typeof(string)))
{
//do some stuff
}
//return some stuff
}
typeToTranslate
actually aType
object, and not some other type? – Acculturate