mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-06 19:44:58 +00:00
perf: minimize temporary strings for better performance (#1255)
This commit is contained in:
parent
53a55467f1
commit
48bb8e91de
8 changed files with 35 additions and 23 deletions
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Avalonia.Collections;
|
||||
|
@ -584,7 +584,7 @@ namespace SourceGit.ViewModels
|
|||
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
var prefixLen = home.EndsWith('/') ? home.Length - 1 : home.Length;
|
||||
if (path.StartsWith(home, StringComparison.Ordinal))
|
||||
path = "~" + path.Substring(prefixLen);
|
||||
path = $"~{path.AsSpan().Slice(prefixLen)}";
|
||||
}
|
||||
|
||||
Title = $"[{workspace}] {name} ({path})";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue