summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-02 22:05:00 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-02 22:05:00 -0400
commit73e3735dcd3b5789d4541e22988db9db2854a69f (patch)
tree80c192fa1e07a242c09c5ad7895071e0a7d6ef7c /src/SMAPI/Framework
parent6f4063cd868539a3de2057a363681c48da029f4e (diff)
downloadSMAPI-73e3735dcd3b5789d4541e22988db9db2854a69f.tar.gz
SMAPI-73e3735dcd3b5789d4541e22988db9db2854a69f.tar.bz2
SMAPI-73e3735dcd3b5789d4541e22988db9db2854a69f.zip
undo parallel loop (#716)
This caused errors during rewriting to be obfuscated with null reference exceptions.
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs11
1 files changed, 6 insertions, 5 deletions
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>Returns whether the module was modified.</returns>
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 <Module>
+ continue; // special type like <Module>
anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes);
anyRewritten |= this.RewriteGenericParameters(type.GenericParameters);
@@ -107,9 +108,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
}
}
}
+ }
- return anyRewritten;
- }).Max();
+ return anyRewritten;
}