Skip to content

Commit

Permalink
Sort usings with Ordinal culture (#1051) (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkudera authored Nov 30, 2023
1 parent 69d7957 commit e705d9a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Src/CSharpier/SyntaxPrinter/UsingDirectives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,18 @@ public int Compare(UsingDirectiveSyntax? x, UsingDirectiveSyntax? y)

if (x.Alias is not null && y.Alias is not null)
{
return x.Alias.ToFullString().CompareTo(y.Alias.ToFullString());
return String.Compare(
x.Alias.ToFullString(),
y.Alias.ToFullString(),
StringComparison.Ordinal
);
}

return x.Name.ToFullString().CompareTo(y.Name.ToFullString());
return String.Compare(
x.Name.ToFullString(),
y.Name.ToFullString(),
StringComparison.Ordinal
);
}
}
}

0 comments on commit e705d9a

Please sign in to comment.