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.
|
* Mod warnings are now listed alphabetically.
|
||||||
* MacOS files starting with `._` are now ignored and can no longer cause skipped mods.
|
* MacOS files starting with `._` are now ignored and can no longer cause skipped mods.
|
||||||
* Simplified paranoid warning logs and reduced their log level.
|
* Simplified paranoid warning logs and reduced their log level.
|
||||||
* Reduced startup time when loading mod DLLs (thanks to ZaneYork!).
|
|
||||||
* Fixed `BadImageFormatException` error detection.
|
* Fixed `BadImageFormatException` error detection.
|
||||||
* Fixed black maps on Android for mods which use `.tmx` files.
|
* Fixed black maps on Android for mods which use `.tmx` files.
|
||||||
|
|
||||||
|
|
|
@ -57,11 +57,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
|
||||||
/// <returns>Returns whether the module was modified.</returns>
|
/// <returns>Returns whether the module was modified.</returns>
|
||||||
public bool RewriteModule()
|
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)
|
if (type.BaseType == null)
|
||||||
return false; // special type like <Module>
|
continue; // special type like <Module>
|
||||||
|
|
||||||
anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes);
|
anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes);
|
||||||
anyRewritten |= this.RewriteGenericParameters(type.GenericParameters);
|
anyRewritten |= this.RewriteGenericParameters(type.GenericParameters);
|
||||||
|
@ -107,9 +108,9 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return anyRewritten;
|
return anyRewritten;
|
||||||
}).Max();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue