From b34d7470e2769a50e87a33e1cb3a8da637a2f143 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 18 May 2020 17:24:16 -0400 Subject: simplify patch facade (#711) Thanks to 0x0ade for the suggestion! --- src/SMAPI/Framework/RewriteFacades/HarmonyInstanceMethods.cs | 3 +-- 1 file changed, 1 insertion(+), 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) { -- cgit