From 73e3735dcd3b5789d4541e22988db9db2854a69f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 2 Jun 2020 22:05:00 -0400 Subject: undo parallel loop (#716) This caused errors during rewriting to be obfuscated with null reference exceptions. --- src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/SMAPI/Framework') diff --git a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs index aafdefc6..c774c038 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs @@ -57,11 +57,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework /// Returns whether the module was modified. public bool RewriteModule() { - return this.Module.GetTypes().AsParallel().WithExecutionMode(ParallelExecutionMode.ForceParallelism).Select(type => + bool anyRewritten = false; + + foreach (TypeDefinition type in this.Module.GetTypes()) { - bool anyRewritten = false; if (type.BaseType == null) - return false; // special type like + continue; // special type like anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes); anyRewritten |= this.RewriteGenericParameters(type.GenericParameters); @@ -107,9 +108,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework } } } + } - return anyRewritten; - }).Max(); + return anyRewritten; } -- cgit