perf: minimize temporary strings for better performance (#1292)

This commit is contained in:
qiufengshe 2025-05-09 09:19:33 +08:00 committed by GitHub
parent 5d1601086f
commit 15ee2dac91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 18 deletions

View file

@ -1502,7 +1502,7 @@ namespace SourceGit.Views
{
if (line.Content.Length > 10000)
{
builder.Append(line.Content.Substring(0, 1000));
builder.Append(line.Content.AsSpan().Slice(0, 1000));
builder.Append($"...({line.Content.Length - 1000} characters trimmed)");
}
else