Delete call to `GetMethod` in runtime type system (#85902)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Mon, 8 May 2023 23:50:12 +0000 (08:50 +0900)
committerGitHub <noreply@github.com>
Mon, 8 May 2023 23:50:12 +0000 (08:50 +0900)
I think this is a leftover from one of the appmodels that we deleted. I don't believe this ever returns non-empty enumeration.

src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/TypeSystem/TypeSystemContext.Runtime.cs

index d37e5a6..2e14ecd 100644 (file)
@@ -431,15 +431,6 @@ namespace Internal.TypeSystem
                             MethodDesc typicalMethod = key._owningType.Context.ResolveRuntimeMethod(key._unboxingStub, (DefType)key._owningType.GetTypeDefinition(), key._methodNameAndSignature, IntPtr.Zero, false);
                             return typicalMethod.Context.GetMethodForInstantiatedType(typicalMethod, (InstantiatedType)key._owningType);
                         }
-
-                        // Otherwise, just check to see if there is a method discoverable via GetMethods
-                        foreach (MethodDesc potentialMethod in key._owningType.GetMethods())
-                        {
-                            if (CompareKeyToValue(key, potentialMethod))
-                            {
-                                return potentialMethod;
-                            }
-                        }
                     }
                     else
                     {