Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify StringComparer.Ordinal to sort namespaces. #65

Merged
merged 1 commit into from Dec 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MasterMemory.GeneratorCore/CodeGenerator.cs
Expand Up @@ -46,7 +46,7 @@ public void GenerateFile(string usingNamespace, string inputDirectory, string ou
Directory.CreateDirectory(outputDirectory);
}

var usingStrings = string.Join(Environment.NewLine, list.SelectMany(x => x.UsingStrings).Distinct().OrderBy(x => x));
var usingStrings = string.Join(Environment.NewLine, list.SelectMany(x => x.UsingStrings).Distinct().OrderBy(x => x, StringComparer.Ordinal));

var builderTemplate = new DatabaseBuilderTemplate();
var databaseTemplate = new MemoryDatabaseTemplate();
Expand Down Expand Up @@ -146,7 +146,7 @@ IEnumerable<GenerationContext> CreateGenerationContext(string filePath)
.Concat(ns)
.Select(x => x.Trim(';') + ";")
.Distinct()
.OrderBy(x => x)
.OrderBy(x => x, StringComparer.Ordinal)
.ToArray();

foreach (var classDecl in classDeclarations)
Expand Down