Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93fb973

Browse files
committed
Minor change
1 parent 6c70561 commit 93fb973

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/runtime/MethodBinder.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ internal Binding Bind(BorrowedReference inst, BorrowedReference args, BorrowedRe
718718
}
719719
}
720720

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

755755
var margs = bestMatch.ManagedArgs;
756756
var outs = bestMatch.Outs;
@@ -1116,14 +1116,15 @@ private readonly struct MatchedMethod
11161116
public int KwargsMatched { get; }
11171117
public object?[] ManagedArgs { get; }
11181118
public int Outs { get; }
1119-
public MethodBase Method { get; }
1119+
public MethodInformation MethodInformation { get; }
1120+
public MethodBase Method => MethodInformation.MethodBase;
11201121

1121-
public MatchedMethod(int kwargsMatched, object?[] margs, int outs, MethodBase mb)
1122+
public MatchedMethod(int kwargsMatched, object?[] margs, int outs, MethodInformation methodInformation)
11221123
{
11231124
KwargsMatched = kwargsMatched;
11241125
ManagedArgs = margs;
11251126
Outs = outs;
1126-
Method = mb;
1127+
MethodInformation = methodInformation;
11271128
}
11281129
}
11291130

0 commit comments

Comments
 (0)