diff options
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs index c774c038..aafdefc6 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs @@ -57,12 +57,11 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// <returns>Returns whether the module was modified.</returns> public bool RewriteModule() { - bool anyRewritten = false; - - foreach (TypeDefinition type in this.Module.GetTypes()) + return this.Module.GetTypes().AsParallel().WithExecutionMode(ParallelExecutionMode.ForceParallelism).Select(type => { + bool anyRewritten = false; if (type.BaseType == null) - continue; // special type like <Module> + return false; // special type like <Module> anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes); anyRewritten |= this.RewriteGenericParameters(type.GenericParameters); @@ -108,9 +107,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework } } } - } - return anyRewritten; + return anyRewritten; + }).Max(); } |