Skip to content

Commit

Permalink
Tiny speedup to HasGenericVirtualMethods (#82383)
Browse files Browse the repository at this point in the history
This avoids materializing/resolving non-virtual methods.
  • Loading branch information
MichalStrehovsky committed Feb 20, 2023
1 parent ce719aa commit b122efb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/tools/Common/Compiler/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static bool IsArrayMethod(this MethodDesc method)
/// </summary>
public static bool HasGenericVirtualMethods(this TypeDesc type)
{
foreach (var method in type.GetAllMethods())
foreach (var method in type.GetAllVirtualMethods())
{
if (method.IsVirtual && method.HasInstantiation)
if (method.HasInstantiation)
return true;
}

Expand Down

0 comments on commit b122efb

Please sign in to comment.