Use null-propogation where applicable and useful.
Primarily where it means one fewer field-access or simplifies event delegate invocation, though one or two cases have just the lesser advantage of allowing an IL stack dup rather than local access.
This commit is contained in:
@@ -1182,11 +1182,7 @@ namespace Newtonsoft.Json
|
||||
|
||||
internal void OnError(ErrorEventArgs e)
|
||||
{
|
||||
EventHandler<ErrorEventArgs> error = Error;
|
||||
if (error != null)
|
||||
{
|
||||
error(this, e);
|
||||
}
|
||||
Error?.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user