[NaturalComparer] Case management

This commit is contained in:
Matt Nadareski
2017-06-02 13:11:59 -07:00
parent 20b6208211
commit 674e20d1d8
2 changed files with 4 additions and 4 deletions

View File

@@ -35,9 +35,9 @@ namespace NaturalSort
public override int Compare(string x, string y) public override int Compare(string x, string y)
{ {
if (x == y) if (x.ToLowerInvariant() == y.ToLowerInvariant())
{ {
return 0; return x.CompareTo(y);
} }
string[] x1, y1; string[] x1, y1;
if (!table.TryGetValue(x, out x1)) if (!table.TryGetValue(x, out x1))

View File

@@ -35,9 +35,9 @@ namespace NaturalSort
public override int Compare(string x, string y) public override int Compare(string x, string y)
{ {
if (x == y) if (y.ToLowerInvariant() == x.ToLowerInvariant())
{ {
return 0; return y.CompareTo(x);
} }
string[] x1, y1; string[] x1, y1;
if (!table.TryGetValue(x, out x1)) if (!table.TryGetValue(x, out x1))