-Refactor

This commit is contained in:
James Newton-King
2015-12-20 18:07:25 +13:00
parent 4304ea6431
commit a7046b0f6c
8 changed files with 28 additions and 40 deletions
+5 -1
View File
@@ -2113,7 +2113,11 @@ namespace Newtonsoft.Json.Linq
if (reader.TokenType == JsonToken.None)
{
if (!(settings != null && settings.CommentHandling == CommentHandling.Ignore ? reader.ReadToContent() : reader.Read()))
bool hasContent = (settings != null && settings.CommentHandling == CommentHandling.Ignore)
? reader.ReadAndMoveToContent()
: reader.Read();
if (!hasContent)
{
throw JsonReaderException.Create(reader, "Error reading JToken from JsonReader.");
}