Skip to content

Commit

Permalink
Optimise the workspacesList list
Browse files Browse the repository at this point in the history
  • Loading branch information
drakon64 committed Nov 29, 2024
1 parent db5c318 commit 5f377e5
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions Amaurot.Processor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,13 @@ from changedDirectory in changedDirectories
from workspace in amaurotJson.Workspaces
where workspace.Directory == changedDirectory
select workspace
)
.Distinct()
.ToList();
foreach (var workspace in amaurotJson.Workspaces)
{
if (workspace.VarFiles is null)
continue;

workspacesList.AddRange(
(
from changedTfVar in changedTfVars
where workspace.VarFiles.Contains(changedTfVar)
select workspace
).Distinct()
);
}
).ToList();
workspacesList.AddRange(
from workspace in amaurotJson.Workspaces
from changedTfVar in changedTfVars
where workspace.VarFiles.Contains(changedTfVar)
select workspace
);
var workspaces = workspacesList.Distinct().ToArray();

if (workspaces.Length == 0)
Expand Down

0 comments on commit 5f377e5

Please sign in to comment.