Replace is-and-cast with as-and-nullcheck

Gives slightly better performance, so applying across the board
adds up.
This commit is contained in:
Jon Hanna
2017-01-05 01:52:04 +00:00
parent 306c3a812b
commit a95665b481
16 changed files with 136 additions and 109 deletions
@@ -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);