From eda7c3e5247c4dcbcb8fb721405ac83a5ef95559 Mon Sep 17 00:00:00 2001 From: stakx Date: Mon, 3 Sep 2018 18:32:51 +0200 Subject: [PATCH] Remove unnecessary type check The check being removed here was introduced by #335, which fixed a regression by reproducing type matching logic from the .NET reference source for `Type.GetMethod(string, BindingFlags, Binder, Type[], ..)`. This check is likely not needed, and we have no test that demonstrates why it might be needed. Removing this special check however will allow us to merge the method it appears in with other similar methods. --- src/Moq/Extensions.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Moq/Extensions.cs b/src/Moq/Extensions.cs index 35bfead23..30661adda 100644 --- a/src/Moq/Extensions.cs +++ b/src/Moq/Extensions.cs @@ -218,11 +218,7 @@ public static bool HasCompatibleParameterTypes(this MethodInfo method, Type[] pa for (int i = 0; i < parameters.Length; i++) { var parameterType = paramTypes[i]; - if (parameterType == typeof(object)) - { - continue; - } - else if (exactParameterMatch && parameters[i].ParameterType != parameterType) + if (exactParameterMatch && parameters[i].ParameterType != parameterType) { return false; }