Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed Oct 31, 2024
1 parent 6c70561 commit 93fb973
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/runtime/MethodBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ internal Binding Bind(BorrowedReference inst, BorrowedReference args, BorrowedRe
}
}

var match = new MatchedMethod(kwargsMatched, margs, outs, mi);
var match = new MatchedMethod(kwargsMatched, margs, outs, methodInformation);
if (usedImplicitConversion)
{
if (matchesUsingImplicitConversion == null)
Expand Down Expand Up @@ -750,7 +750,7 @@ internal Binding Bind(BorrowedReference inst, BorrowedReference args, BorrowedRe
.GroupBy(x => x.KwargsMatched)
.OrderByDescending(x => x.Key)
.First()
.MinBy(x => GetMatchedArgumentsPrecedence(methods.First(m => m.MethodBase == x.Method), pyArgCount, kwArgDict?.Keys));
.MinBy(x => GetMatchedArgumentsPrecedence(x.MethodInformation, pyArgCount, kwArgDict?.Keys));

var margs = bestMatch.ManagedArgs;
var outs = bestMatch.Outs;
Expand Down Expand Up @@ -1116,14 +1116,15 @@ private readonly struct MatchedMethod
public int KwargsMatched { get; }
public object?[] ManagedArgs { get; }
public int Outs { get; }
public MethodBase Method { get; }
public MethodInformation MethodInformation { get; }
public MethodBase Method => MethodInformation.MethodBase;

public MatchedMethod(int kwargsMatched, object?[] margs, int outs, MethodBase mb)
public MatchedMethod(int kwargsMatched, object?[] margs, int outs, MethodInformation methodInformation)
{
KwargsMatched = kwargsMatched;
ManagedArgs = margs;
Outs = outs;
Method = mb;
MethodInformation = methodInformation;
}
}

Expand Down

0 comments on commit 93fb973

Please sign in to comment.