Skip to content

Commit

Permalink
Eliminate string allocation in CodeInlineRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon committed Feb 9, 2024
1 parent 6a15c80 commit 2ca05cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Markdig/Renderers/Normalize/Inlines/CodeInlineRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ protected override void Write(NormalizeRenderer renderer, CodeInline obj)
if (delimiterCount < count)
delimiterCount = count;
}
var delimiterRun = new string(obj.Delimiter, delimiterCount + 1);
renderer.Write(delimiterRun);

renderer.Write(obj.Delimiter, delimiterCount + 1);
if (content.Length != 0)
{
if (content[0] == obj.Delimiter)
Expand All @@ -49,6 +49,6 @@ protected override void Write(NormalizeRenderer renderer, CodeInline obj)
{
renderer.Write(' ');
}
renderer.Write(delimiterRun);
renderer.Write(obj.Delimiter, delimiterCount + 1);
}
}

0 comments on commit 2ca05cc

Please sign in to comment.