Faster path for Netcoreapp2.0

This commit is contained in:
Ben Adams
2017-08-28 16:43:04 +01:00
parent 56262bc917
commit 621c493b42
7 changed files with 31 additions and 21 deletions
+3 -3
View File
@@ -291,7 +291,7 @@ namespace Newtonsoft.Json
if (_currentState == State.Property)
{
t = WriteNullAsync(cancellationToken);
if (t.Status != TaskStatus.RanToCompletion)
if (!t.IsCompletedSucessfully())
{
return AwaitProperty(t, levelsToComplete, token, type, cancellationToken);
}
@@ -302,7 +302,7 @@ namespace Newtonsoft.Json
if (_currentState != State.ObjectStart && _currentState != State.ArrayStart)
{
t = WriteIndentAsync(cancellationToken);
if (t.Status != TaskStatus.RanToCompletion)
if (!t.IsCompletedSucessfully())
{
return AwaitIndent(t, levelsToComplete, token, type, cancellationToken);
}
@@ -310,7 +310,7 @@ namespace Newtonsoft.Json
}
t = WriteEndAsync(token, cancellationToken);
if (t.Status != TaskStatus.RanToCompletion)
if (!t.IsCompletedSucessfully())
{
return AwaitEnd(t, levelsToComplete, type, cancellationToken);
}