Equals(item, null) or item == null

后端 未结 6 1226
深忆病人
深忆病人 2020-12-07 23:14

Is code that uses the static Object.Equals to check for null more robust than code that uses the == operator or regular Object.Equals? Aren\'t the latter two vulnerable to b

6条回答
  •  春和景丽
    2020-12-07 23:20

    if (Equals(item, null)) is no more robust than if (item == null), and I find it more confusing to boot.

提交回复
热议问题