Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed May 14, 2024
1 parent 5736d51 commit 65ad1b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/runtime/MethodBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,7 @@ internal Binding Bind(BorrowedReference inst, BorrowedReference args, BorrowedRe
}

var match = new MatchedMethod(kwargsMatched, margs, outs, mi);
// Only add matches using implicit conversion if no other regular matches were found,
// since we favor regular matches over matches using implicit conversion
if (usedImplicitConversion && matches.Count == 0)
if (usedImplicitConversion)
{
if (matchesUsingImplicitConversion == null)
{
Expand All @@ -709,7 +707,7 @@ internal Binding Bind(BorrowedReference inst, BorrowedReference args, BorrowedRe
else
{
matches.Add(match);
// We don't need the matches using implicit conversion anymore
// We don't need the matches using implicit conversion anymore, we can free the memory
matchesUsingImplicitConversion = null;
}
}
Expand Down

0 comments on commit 65ad1b9

Please sign in to comment.