minimize temporary strings for better performance

This commit is contained in:
qiufengshe 2025-04-19 15:32:10 +08:00
parent 61a1b130f2
commit 979b8f9da6

View file

@ -1,4 +1,4 @@
using System;
using System;
namespace SourceGit.Commands
{
@ -40,7 +40,7 @@ namespace SourceGit.Commands
if (dateEndIdx == -1)
return;
var dateStr = line.Substring(0, dateEndIdx);
var dateStr = line.AsSpan().Slice(0, dateEndIdx);
if (double.TryParse(dateStr, out var date))
statistics.AddCommit(line.Substring(dateEndIdx + 1), date);
}