Skip to content

Commit

Permalink
Apparently Linq slows things down
Browse files Browse the repository at this point in the history
I guess it matters at scale
  • Loading branch information
blowfishpro committed Oct 18, 2017
1 parent 7cc6c51 commit bd82d53
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ModuleManager/PatchApplier.cs
Expand Up @@ -181,7 +181,17 @@ private static bool IsMatch(ConfigNode node, string type, string[] namePatterns,
string name = node.GetValue("name");
if (name == null) return false;

if (!namePatterns.Any(pattern => MMPatchLoader.WildcardMatch(name, pattern))) return false;
bool match = false;
foreach (string pattern in namePatterns)
{
if (MMPatchLoader.WildcardMatch(name, pattern))
{
match = true;
break;
}
}

if (!match) return false;
}

return MMPatchLoader.CheckConstraints(node, constraints);
Expand Down

0 comments on commit bd82d53

Please sign in to comment.