Simplify Equals override in JValue (#1148)

otherValue == null, including obj == null, both result in false and
will also result in false if continued into the Equals(JValue) method
in the first branch, so having separate branches is just extra work.
This commit is contained in:
Jon Hanna
2017-01-08 15:33:03 +13:00
committed by James Newton-King
parent ed99856139
commit 2061a8bb9a
+1 -12
View File
@@ -871,18 +871,7 @@ namespace Newtonsoft.Json.Linq
/// </returns>
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
JValue otherValue = obj as JValue;
if (otherValue != null)
{
return Equals(otherValue);
}
return base.Equals(obj);
return Equals(obj as JValue);
}
/// <summary>