Skip to content

Commit 161f496

Browse files
authored
codegen: 🐛 Fix consistent ordering of units (#1235)
The ordering seemed to vary on computers resulting in annoying diffs for PRs. Fixed by specifying the string comparer, assuming the default was affected by the system's culture. Verified fix in a recent PR where running codegen locally resulted in a diff. With this fix, there was no diff.
1 parent 8ba84f1 commit 161f496

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeGen/Generators/QuantityJsonFilesParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static Quantity ParseQuantityFile(string jsonFileName)
6060

6161
private static void OrderUnitsByName(Quantity quantity)
6262
{
63-
quantity.Units = quantity.Units.OrderBy(u => u.SingularName).ToArray();
63+
quantity.Units = quantity.Units.OrderBy(u => u.SingularName, StringComparer.OrdinalIgnoreCase).ToArray();
6464
}
6565

6666
private static void FixConversionFunctionsForDecimalValueTypes(Quantity quantity)

0 commit comments

Comments
 (0)