我不明白为什么Resharper建议我在这段代码中“改为检查引用相等性”:if(typeToTranslate.Equals(typeof(string))){//dosomething}为什么这应该更好:typeToTranslate==typeof(string)------------编辑------------这是方法stub:protectedITypeTranslateType(TypetypeToTranslate){if(typeToTranslate==null)thrownewArgumentNullException("typeToTranslate");//do
我不明白为什么Resharper建议我在这段代码中“改为检查引用相等性”:if(typeToTranslate.Equals(typeof(string))){//dosomething}为什么这应该更好:typeToTranslate==typeof(string)------------编辑------------这是方法stub:protectedITypeTranslateType(TypetypeToTranslate){if(typeToTranslate==null)thrownewArgumentNullException("typeToTranslate");//do