Skip to content

Commit 7e13495

Browse files
committed
breaking: Change WriteSolutionFile to take a List<>
1 parent 9f89346 commit 7e13495

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

ICSharpCode.Decompiler/Solution/SolutionCreator.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static class SolutionCreator
4141
/// <exception cref="ArgumentException">Thrown when <paramref name="targetFile"/> is null or empty.</exception>
4242
/// <exception cref="ArgumentNullException">Thrown when <paramref name="projects"/> is null.</exception>
4343
/// <exception cref="InvalidOperationException">Thrown when <paramref name="projects"/> contains no items.</exception>
44-
public static void WriteSolutionFile(string targetFile, IEnumerable<ProjectItem> projects)
44+
public static void WriteSolutionFile(string targetFile, List<ProjectItem> projects)
4545
{
4646
if (string.IsNullOrWhiteSpace(targetFile))
4747
{
@@ -53,19 +53,17 @@ public static void WriteSolutionFile(string targetFile, IEnumerable<ProjectItem>
5353
throw new ArgumentNullException(nameof(projects));
5454
}
5555

56-
var projectList = projects.ToList();
57-
58-
if (!projectList.Any())
56+
if (!projects.Any())
5957
{
6058
throw new InvalidOperationException("At least one project is expected.");
6159
}
6260

6361
using (var writer = new StreamWriter(targetFile))
6462
{
65-
WriteSolutionFile(writer, projectList, targetFile);
63+
WriteSolutionFile(writer, projects, targetFile);
6664
}
6765

68-
FixProjectReferences(projectList);
66+
FixProjectReferences(projects);
6967
}
7068

7169
static void WriteSolutionFile(TextWriter writer, List<ProjectItem> projects, string solutionFilePath)

ILSpy/SolutionWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ await Task.Run(() => Parallel.ForEach(Partitioner.Create(assemblies),
153153
}
154154
else
155155
{
156-
await Task.Run(() => SolutionCreator.WriteSolutionFile(solutionFilePath, projects))
157-
.ConfigureAwait(false);
156+
await Task.Run(() => SolutionCreator.WriteSolutionFile(solutionFilePath, projects.ToList()))
157+
.ConfigureAwait(false);
158158
}
159159
}
160160
catch (AggregateException ae)

0 commit comments

Comments
 (0)