Skip to content

Commit

Permalink
Small perf improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Knagis committed Sep 13, 2014
1 parent 1f298be commit 11b77e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CommonMark/Parser/BlockMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ static void add_line(Block block, string ln, int offset)
if (!block.IsOpen)
throw new CommonMarkException(string.Format("Attempted to add line '{0}' to closed container ({1}).", ln, block.Tag));

block.StringContent += s;
var curSC = block.StringContent;
if (curSC == null)
block.StringContent = s;
else
block.StringContent = curSC + s;
}

/// <remarks>Original: remove_trailing_blank_lines(ref string)</remarks>
Expand Down
1 change: 0 additions & 1 deletion CommonMark/Syntax/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public Block(BlockTag tag, int startLine, int startColumn)
this.StartLine = startLine;
this.EndLine = startLine;
this.StartColumn = startColumn;
this.StringContent = string.Empty;
this.IsOpen = true;
}

Expand Down

0 comments on commit 11b77e5

Please sign in to comment.