Skip to content

Commit

Permalink
Only convert to array once per pass
Browse files Browse the repository at this point in the history
This is expensive
  • Loading branch information
blowfishpro committed Oct 14, 2017
1 parent a6d6519 commit 5fe79fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ModuleManager/PatchApplier.cs
Expand Up @@ -50,6 +50,8 @@ private void ApplyPatches(string stage, IEnumerable<UrlDir.UrlConfig> patches)
logger.Info(stage + " pass");
Activity = "ModuleManager " + stage;

UrlDir.UrlConfig[] allConfigs = databaseRoot.AllConfigs.ToArray();

foreach (UrlDir.UrlConfig mod in patches)
{
try
Expand Down Expand Up @@ -79,7 +81,7 @@ private void ApplyPatches(string stage, IEnumerable<UrlDir.UrlConfig> patches)
string[] patterns = splits.Length > 1 ? splits[1].Split(',', '|') : new string[] { null };
string type = splits[0].Substring(1);

foreach (UrlDir.UrlConfig url in databaseRoot.AllConfigs.ToArray())
foreach (UrlDir.UrlConfig url in allConfigs)
{
foreach (string pattern in patterns)
{
Expand Down

0 comments on commit 5fe79fd

Please sign in to comment.