undo parallel loop (#716)
This caused errors during rewriting to be obfuscated with null reference exceptions.
This commit is contained in:
parent
6f4063cd86
commit
73e3735dcd
|
@ -6,7 +6,6 @@
|
|||
* Mod warnings are now listed alphabetically.
|
||||
* MacOS files starting with `._` are now ignored and can no longer cause skipped mods.
|
||||
* Simplified paranoid warning logs and reduced their log level.
|
||||
* Reduced startup time when loading mod DLLs (thanks to ZaneYork!).
|
||||
* Fixed `BadImageFormatException` error detection.
|
||||
* Fixed black maps on Android for mods which use `.tmx` files.
|
||||
|
||||
|
|
|
@ -56,12 +56,13 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
|
|||
/// <summary>Rewrite the loaded module code.</summary>
|
||||
/// <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())
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue