mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 19:55:00 +00:00
minimize temporary strings for better performance (#1224)
* minimize temporary strings for better performance * minimize temporary strings for better performance (cherry picked from commit c9e6a8d4c2d7b5fe03ee13af0a79c5334c23b1c0)
This commit is contained in:
parent
6882ae069f
commit
9f18cbca5b
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ namespace SourceGit.Commands
|
||||||
}
|
}
|
||||||
else if (line.StartsWith("-size ", StringComparison.Ordinal))
|
else if (line.StartsWith("-size ", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
_result.LFSDiff.Old.Size = long.Parse(line.Substring(6));
|
_result.LFSDiff.Old.Size = long.Parse(line.AsSpan().Slice(6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ch == '+')
|
else if (ch == '+')
|
||||||
|
@ -114,12 +114,12 @@ namespace SourceGit.Commands
|
||||||
}
|
}
|
||||||
else if (line.StartsWith("+size ", StringComparison.Ordinal))
|
else if (line.StartsWith("+size ", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
_result.LFSDiff.New.Size = long.Parse(line.Substring(6));
|
_result.LFSDiff.New.Size = long.Parse(line.AsSpan().Slice(6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (line.StartsWith(" size ", StringComparison.Ordinal))
|
else if (line.StartsWith(" size ", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
_result.LFSDiff.New.Size = _result.LFSDiff.Old.Size = long.Parse(line.Substring(6));
|
_result.LFSDiff.New.Size = _result.LFSDiff.Old.Size = long.Parse(line.AsSpan().Slice(6));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue