-Performance improvements

This commit is contained in:
JamesNK
2012-01-08 00:54:53 +00:00
parent 1bd20261c2
commit 90297804e1
9 changed files with 149 additions and 98 deletions
+7 -10
View File
@@ -211,17 +211,14 @@ namespace Newtonsoft.Json
/// </summary>
protected override void WriteIndent()
{
if (Formatting == Formatting.Indented)
_writer.Write(Environment.NewLine);
// levels of indentation multiplied by the indent count
int currentIndentCount = Top*_indentation;
for (int i = 0; i < currentIndentCount; i++)
{
_writer.Write(Environment.NewLine);
// levels of indentation multiplied by the indent count
int currentIndentCount = Top * _indentation;
for (int i = 0; i < currentIndentCount; i++)
{
_writer.Write(_indentChar);
}
_writer.Write(_indentChar);
}
}