Replace is-and-cast with as-and-nullcheck
Gives slightly better performance, so applying across the board adds up.
This commit is contained in:
@@ -139,9 +139,9 @@ namespace Newtonsoft.Json.Utilities
|
||||
callExpression = Expression.Call(readParameter, (MethodInfo)method, argsExpression);
|
||||
}
|
||||
|
||||
if (method is MethodInfo)
|
||||
MethodInfo m = method as MethodInfo;
|
||||
if (m != null)
|
||||
{
|
||||
MethodInfo m = (MethodInfo)method;
|
||||
if (m.ReturnType != typeof(void))
|
||||
{
|
||||
callExpression = EnsureCastExpression(callExpression, type);
|
||||
|
||||
Reference in New Issue
Block a user