Mig*_*uel 5 c# icomparable
我有一个T实现类型的对象IComparable<T>.实施时bool Equals (T obj)可以省略支票if (ReferenceEquals(this, null)) { DoSomething() }吗?我可以假设,因为可以调用函数this已经不是空的吗?
T
IComparable<T>
bool Equals (T obj)
if (ReferenceEquals(this, null)) { DoSomething() }
this
非常感谢你.
Nic*_*ick 3
是的,您可以假设如果已在对象上调用该函数,则该对象不是null。
null
归档时间:
14 年,9 月 前
查看次数:
180 次
最近记录: