Skip to content

Commit

Permalink
Don't write using alias for the same type multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
dassjosh committed Oct 18, 2023
1 parent 6ae45d9 commit a1c2189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PluginMerge/Creator/FileCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ private void WriteExtensionUsings()
}
}

HashSet<string> addedTypes = new();
foreach (FileType file in _extensionTypes)
{
foreach (string type in allTypes)
{
if (file.ContainsType(type))
if (file.ContainsType(type) && addedTypes.Add(type))
{
_writer.WriteIndent();
_writer.WriteUsingAlias(type, $"{_settings.Merge.PluginName}.{type}");
Expand Down

0 comments on commit a1c2189

Please sign in to comment.