File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -2032,13 +2032,14 @@ bool ConstraintSystem::solveForDisjunctionChoices(
2032
2032
// short-circuit the disjunction.
2033
2033
if (lastSolvedChoice) {
2034
2034
Constraint *lastChoice = lastSolvedChoice->first ;
2035
- auto &score = lastSolvedChoice->second ;
2036
- bool hasUnavailableOverloads = score.Data [SK_Unavailable] > 0 ;
2037
- bool hasFixes = score.Data [SK_Fix] > 0 ;
2038
-
2039
- // Attempt to short-circuit disjunction only if score indicates
2040
- // that there are no unavailable overload choices present in the
2041
- // solution, and the solution does not involve fixes.
2035
+ auto delta = lastSolvedChoice->second - CurrentScore;
2036
+ bool hasUnavailableOverloads = delta.Data [SK_Unavailable] > 0 ;
2037
+ bool hasFixes = delta.Data [SK_Fix] > 0 ;
2038
+
2039
+ // Attempt to short-circuit evaluation of this disjunction only
2040
+ // if the disjunction choice we are comparing to did not involve
2041
+ // selecting unavailable overloads or result in fixes being
2042
+ // applied to reach a solution.
2042
2043
if (!hasUnavailableOverloads && !hasFixes &&
2043
2044
shortCircuitDisjunctionAt (currentChoice, lastChoice, getASTContext ()))
2044
2045
break ;
You can’t perform that action at this time.
0 commit comments