mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
parent
a363f67f31
commit
48725a7937
1 changed files with 2 additions and 15 deletions
|
@ -50,22 +50,9 @@
|
||||||
string sub2 = new string(tmp2, 0, loc2);
|
string sub2 = new string(tmp2, 0, loc2);
|
||||||
int result;
|
int result;
|
||||||
if (isDigit1 && isDigit2)
|
if (isDigit1 && isDigit2)
|
||||||
{
|
result = loc1 == loc2 ? string.CompareOrdinal(sub1, sub2) : loc1 - loc2;
|
||||||
// compare numeric values
|
|
||||||
if (sub1.Length == sub2.Length)
|
|
||||||
{
|
|
||||||
// if length is the same, lexicographical comparison is good also for numbers
|
|
||||||
result = string.CompareOrdinal(sub1, sub2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = sub1.Length.CompareTo(sub2.Length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
result = string.CompareOrdinal(sub1, sub2);
|
||||||
result = string.Compare(sub1, sub2, System.StringComparison.Ordinal);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue