Skip to content

Commit

Permalink
Little linq optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Nov 14, 2024
1 parent 15d9c8d commit 485a6ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Bannerlord.ModuleManager/ModuleUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static IEnumerable<ModuleIssue> ValidateModule(
{
var visited = new HashSet<ModuleInfoExtended>();
return ValidateModuleEx(modules, targetModule, visited, isSelected,
x => ValidateModuleEx(modules, x, isSelected).Count() == 0)
x => !ValidateModuleEx(modules, x, isSelected).Any())
.Select(x => x.ToLegacy());
}

Expand Down Expand Up @@ -250,7 +250,7 @@ public static IEnumerable<ModuleIssueV2> ValidateModuleEx(
Func<ModuleInfoExtended, bool> isSelected)
{
var visited = new HashSet<ModuleInfoExtended>();
foreach (var issue in ValidateModuleEx(modules, targetModule, visited, isSelected, x => ValidateModuleEx(modules, x, isSelected).Count() == 0))
foreach (var issue in ValidateModuleEx(modules, targetModule, visited, isSelected, x => !ValidateModuleEx(modules, x, isSelected).Any()))
{
yield return issue;
}
Expand Down

0 comments on commit 485a6ec

Please sign in to comment.