Merge pull request #3659 from Bond-009/stringbuilder

Optimize StringBuilder.Append calls
This commit is contained in:
Joshua M. Boniface
2020-07-23 18:08:09 -04:00
committed by GitHub
4 changed files with 25 additions and 15 deletions

View File

@@ -488,7 +488,8 @@ namespace Emby.Server.Implementations.Services
sb.Append(value);
for (var j = pathIx + 1; j < requestComponents.Length; j++)
{
sb.Append(PathSeperatorChar + requestComponents[j]);
sb.Append(PathSeperatorChar)
.Append(requestComponents[j]);
}
value = sb.ToString();
@@ -505,7 +506,8 @@ namespace Emby.Server.Implementations.Services
pathIx++;
while (!string.Equals(requestComponents[pathIx], stopLiteral, StringComparison.OrdinalIgnoreCase))
{
sb.Append(PathSeperatorChar + requestComponents[pathIx++]);
sb.Append(PathSeperatorChar)
.Append(requestComponents[pathIx++]);
}
value = sb.ToString();