diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-18 17:24:16 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-18 17:24:16 -0400 |
commit | b34d7470e2769a50e87a33e1cb3a8da637a2f143 (patch) | |
tree | 5893ab44b7b13553531c729c0f209ca477e1cfef /src/SMAPI | |
parent | e626e5817e66f1133d125ab49866b8a0475dde07 (diff) | |
download | SMAPI-b34d7470e2769a50e87a33e1cb3a8da637a2f143.tar.gz SMAPI-b34d7470e2769a50e87a33e1cb3a8da637a2f143.tar.bz2 SMAPI-b34d7470e2769a50e87a33e1cb3a8da637a2f143.zip |
simplify patch facade (#711)
Thanks to 0x0ade for the suggestion!
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs b/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs index 995a40d6..8e4ef7df 100644 --- a/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs +++ b/src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; using System.Reflection; using System.Reflection.Emit; using HarmonyLib; @@ -31,7 +30,7 @@ namespace StardewModdingAPI.Framework.RewriteFacades try { MethodInfo method = base.Patch(original: original, prefix: prefix, postfix: postfix, transpiler: transpiler); - return new DynamicMethod(method.Name, method.Attributes, method.CallingConvention, method.ReturnType, method.GetParameters().Select(p => p.ParameterType).ToArray(), method.Module, true); + return (DynamicMethod)method; } catch (Exception ex) { |