mio codice è ...Perché il resharper esegue la seguente raccomandazione?
public static void AssertNotNull<T>(string name, T val) {
if (val == null)
throw new ArgumentNullException(String.Format("{0} must not be null", name));
}
ReSharper raccomanda ...
public static void AssertNotNull<T>(string name, T val) {
if (Equals(val, default(T)))
throw new ArgumentNullException(String.Format("{0} must not be null", name));
}
Sono cose come quelle che fanno il resharper del valore di dieci volte. –
Interessante domanda +1, solo una cosa potresti per favore inserire più informazioni nel titolo per rendere più facile trovare la prossima volta di risposta "Perché il resharper consiglia di sostituire val == null con Equals (val, default (T))" Grazie. –