mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSOptimizer] Remove an outdated optimization to compare resolved argument types with all else equal
This is already accounted for by `determineBestChoicesInContext` and reflected in the overall score, which means that we no longer need to use this in vacuum.
This commit is contained in:
@@ -662,16 +662,9 @@ ConstraintSystem::selectDisjunction() {
|
||||
unsigned firstFavored = favorings[first].size();
|
||||
unsigned secondFavored = favorings[second].size();
|
||||
|
||||
// Everything else equal, choose the disjunction with the greatest
|
||||
// number of resolved argument types. The number of resolved argument
|
||||
// types is always zero for disjunctions that don't represent applied
|
||||
// overloads.
|
||||
if (firstFavored == secondFavored) {
|
||||
if (firstActive != secondActive)
|
||||
return firstActive < secondActive;
|
||||
|
||||
return first->countResolvedArgumentTypes(*this) >
|
||||
second->countResolvedArgumentTypes(*this);
|
||||
}
|
||||
|
||||
firstFavored = firstFavored ? firstFavored : firstActive;
|
||||
|
||||
Reference in New Issue
Block a user