-Performance

This commit is contained in:
JamesNK
2009-12-29 02:53:53 +00:00
parent 961945657a
commit 974178a162
9 changed files with 247 additions and 142 deletions
+4 -2
View File
@@ -601,9 +601,11 @@ namespace Newtonsoft.Json
WriteIndentSpace();
}
WriteState writeState = WriteState;
// don't indent a property when it is the first token to be written (i.e. at the start)
if ((tokenBeingWritten == JsonToken.PropertyName && WriteState != WriteState.Start) ||
WriteState == WriteState.Array || WriteState == WriteState.Constructor)
if ((tokenBeingWritten == JsonToken.PropertyName && writeState != WriteState.Start) ||
writeState == WriteState.Array || writeState == WriteState.Constructor)
{
WriteIndent();
}