refactor: use String.AsSpan(int, int) instead of String.AsSpan().Slice(int, int)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-04-29 09:44:06 +08:00
parent 48bb8e91de
commit 825b74c2a3
No known key found for this signature in database
12 changed files with 20 additions and 20 deletions

View file

@ -22,7 +22,7 @@ namespace SourceGit.Converters
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var prefixLen = home.EndsWith('/') ? home.Length - 1 : home.Length;
if (v.StartsWith(home, StringComparison.Ordinal))
return $"~{v.AsSpan().Slice(prefixLen)}";
return $"~{v.AsSpan(prefixLen)}";
return v;
});