Skip to content

Commit

Permalink
sorting fix if name ends with whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed May 19, 2024
1 parent 60a6c1e commit 2a88758
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ARKBreedingStats/utils/NaturalComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ int IComparer<string>.Compare(string aStr, string bStr)

while (true)
{
// Handle when we hit the end of either string
if (aI >= aLen && bI >= bLen) return 0;
if (aI >= aLen) return -1; // The shorter string sorts first
if (bI >= bLen) return 1;

// Skip spaces on both sides, if requested
if (SkipSpaces)
{
aI += SkipWhiteSpace(aStr, aI);
bI += SkipWhiteSpace(bStr, bI);
}

// Handle when we hit the end of either string
if (aI >= aLen && bI >= bLen) return 0;
if (aI >= aLen) return -1; // The shorter string sorts first
if (bI >= bLen) return 1;

// Pick up the next character from each string
char a = aStr[aI];
char b = bStr[bI];
Expand Down

0 comments on commit 2a88758

Please sign in to comment.