Смотрю исходники System.String ("\redbits\ndp\clr\src\BCL\System\String.cs")
// Determines whether two strings match.
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public override bool Equals(Object obj) {
String str = obj as String;
if (str == null)
{
// exception will be thrown later for null this
if (this != null) return false;
}
return EqualsHelper(this, str);
}
(то же и с перегруженной версией с параметром типа string) и не понимаю, зачем проверка "this != null"
Индусы? "Наследие" C++?
... << RSDN@Home 1 alpha 3 rev. 0>>