Skip to content

Commit 924c611

Browse files
committed
Reverse order of loop in MightHaveInterfaceDispatchMap
Presumably the last interfaces on the list are more likely to be coming from the less nested classes and allow short circuiting the loop earlier.
1 parent 7c0f62f commit 924c611

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/InterfaceDispatchMapNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static bool MightHaveInterfaceDispatchMap(TypeDesc type, NodeFactory fact
8989

9090
DefType declType = type.GetClosestDefType();
9191

92-
for (int interfaceIndex = 0; interfaceIndex < declType.RuntimeInterfaces.Length; interfaceIndex++)
92+
for (int interfaceIndex = declType.RuntimeInterfaces.Length - 1; interfaceIndex >= 0; interfaceIndex--)
9393
{
9494
DefType interfaceType = declType.RuntimeInterfaces[interfaceIndex];
9595
InstantiatedType interfaceOnDefinitionType = interfaceType.IsTypeDefinition ?

0 commit comments

Comments
 (0)