提交 6cecb699 编写于 作者: M Marius Ungureanu 提交者: Fabian Toader

Avoid allocation of string when a better stringbuilder overload exists (#62)

上级 0fce1e23
......@@ -265,7 +265,7 @@ private static string RemoveEscapes(string value)
idx = value.IndexOf(Backslash, start);
if (idx < 0)
{
builder.Append(value.Substring(start));
builder.Append(value, start, value.Length - start);
break;
}
else
......@@ -273,7 +273,7 @@ private static string RemoveEscapes(string value)
int clearTextLength = idx - start;
// Copy Clear Text
builder.Append(value.Substring(start, clearTextLength));
builder.Append(value, start, clearTextLength);
// Add the character after the backslash
if (idx + 1 < value.Length)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册