diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs index 762483c27a..458ce775a8 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs @@ -15,7 +15,6 @@ namespace Castle.DynamicProxy.Generators.Emitters { using System; - using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Reflection.Emit; @@ -31,16 +30,14 @@ public static GenericTypeParameterBuilder[] CopyGenericArguments( MethodInfo methodToCopyGenericsFrom, TypeBuilder builder) { - var _ = new Dictionary(); - return CopyGenericArguments(methodToCopyGenericsFrom, _, builder.DefineGenericParameters); + return CopyGenericArguments(methodToCopyGenericsFrom, builder.DefineGenericParameters); } public static GenericTypeParameterBuilder[] CopyGenericArguments( MethodInfo methodToCopyGenericsFrom, MethodBuilder builder) { - var _ = new Dictionary(); - return CopyGenericArguments(methodToCopyGenericsFrom, _, builder.DefineGenericParameters); + return CopyGenericArguments(methodToCopyGenericsFrom, builder.DefineGenericParameters); } private static Type AdjustConstraintToNewGenericParameters( @@ -107,7 +104,6 @@ private static Type[] AdjustGenericConstraints(MethodInfo methodToCopyGenericsFr private static GenericTypeParameterBuilder[] CopyGenericArguments( MethodInfo methodToCopyGenericsFrom, - Dictionary name2GenericType, ApplyGenArgs genericParameterGenerator) { var originalGenericArguments = methodToCopyGenericsFrom.GetGenericArguments(); @@ -136,8 +132,6 @@ private static GenericTypeParameterBuilder[] CopyGenericArguments( newGenericParameters[i].SetGenericParameterAttributes(GenericParameterAttributes.None); } - - name2GenericType[argumentNames[i]] = newGenericParameters[i]; } return newGenericParameters;