Skip to content

Commit 232482c

Browse files
qiufengshelove-linger
authored andcommitted
minimize temporary strings for better performance (#1215)
(cherry picked from commit b4fa80c)
1 parent b4db88a commit 232482c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Commands/Statistics.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22

33
namespace SourceGit.Commands
44
{
@@ -40,7 +40,7 @@ private void ParseLine(Models.Statistics statistics, string line)
4040
if (dateEndIdx == -1)
4141
return;
4242

43-
var dateStr = line.Substring(0, dateEndIdx);
43+
var dateStr = line.AsSpan().Slice(0, dateEndIdx);
4444
if (double.TryParse(dateStr, out var date))
4545
statistics.AddCommit(line.Substring(dateEndIdx + 1), date);
4646
}

0 commit comments

Comments
 (0)