Remove bad calls to ReferenceEquals (#33739)
authorJeremy Barton <jbarton@microsoft.com>
Thu, 19 Mar 2020 09:47:05 +0000 (02:47 -0700)
committerGitHub <noreply@github.com>
Thu, 19 Mar 2020 09:47:05 +0000 (05:47 -0400)
commit1410194ee93ec480f40a7ece47548b30cf558010
tree97958b5569223c4750a28462d97b3fc4a43ab7b1
parent96cb163f32f138fa6a2f018084ff6d90a942683d
Remove bad calls to ReferenceEquals (#33739)

All of these calls to ReferenceEquals pass a value type, which gets boxed, and
ReferenceEquals returns false.
Further, all of the calls originated in .NET Framework, so the moderately
expensive way of saying "false" has been there for a while.

* Inline the expression to `false`
* Further inline and remove dead blocks or unnecessary ifs.
* Delete any comments explaining the code, since they're not relevant.
src/libraries/System.Management/src/System/Management/ManagementScope.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs