@@ -2026,11 +2026,11 @@ static void existingOperatorBindingsForDisjunction(ConstraintSystem &CS, ArrayRe
2026
2026
if (!decl->isOperator ())
2027
2027
return ;
2028
2028
2029
- for (auto *resolved = CS.getResolvedOverloadSets (); resolved;
2030
- resolved = resolved-> Previous ) {
2031
- if (!resolved-> Choice .isDecl ())
2029
+ for (auto overload : CS.getResolvedOverloads ()) {
2030
+ auto resolved = overload. second ;
2031
+ if (!resolved. choice .isDecl ())
2032
2032
continue ;
2033
- auto representativeDecl = resolved-> Choice .getDecl ();
2033
+ auto representativeDecl = resolved. choice .getDecl ();
2034
2034
2035
2035
if (!representativeDecl->isOperator ())
2036
2036
continue ;
@@ -2174,29 +2174,28 @@ Constraint *ConstraintSystem::selectDisjunction() {
2174
2174
2175
2175
// Pick the disjunction with the smallest number of favored, then active choices.
2176
2176
auto cs = this ;
2177
- auto minDisjunction =
2178
- std::min_element (disjunctions.begin (), disjunctions.end (),
2179
- [&](Constraint *first, Constraint *second) -> bool {
2180
- unsigned firstFavored = first->countFavoredNestedConstraints ();
2181
- unsigned secondFavored = second->countFavoredNestedConstraints ();
2182
-
2183
- if (firstFavored == secondFavored) {
2184
- // Look for additional choices to favor
2185
- SmallVector<Constraint *, 4 > firstExisting;
2186
- SmallVector<Constraint *, 4 > secondExisting;
2187
-
2188
- existingOperatorBindingsForDisjunction (*cs, first->getNestedConstraints (), firstExisting);
2189
- firstFavored = firstExisting.size () ?: first->countActiveNestedConstraints ();
2190
- existingOperatorBindingsForDisjunction (*cs, second->getNestedConstraints (), secondExisting);
2191
- secondFavored = secondExisting.size () ?: second->countActiveNestedConstraints ();
2192
-
2193
- return firstFavored < secondFavored;
2194
- } else {
2195
- firstFavored = firstFavored ?: first->countActiveNestedConstraints ();
2196
- secondFavored = secondFavored ?: second->countActiveNestedConstraints ();
2197
- return firstFavored < secondFavored;
2198
- }
2199
- });
2177
+ auto minDisjunction = std::min_element (disjunctions.begin (), disjunctions.end (),
2178
+ [&](Constraint *first, Constraint *second) -> bool {
2179
+ unsigned firstFavored = first->countFavoredNestedConstraints ();
2180
+ unsigned secondFavored = second->countFavoredNestedConstraints ();
2181
+
2182
+ if (firstFavored == secondFavored) {
2183
+ // Look for additional choices to favor
2184
+ SmallVector<Constraint *, 4 > firstExisting;
2185
+ SmallVector<Constraint *, 4 > secondExisting;
2186
+
2187
+ existingOperatorBindingsForDisjunction (*cs, first->getNestedConstraints (), firstExisting);
2188
+ firstFavored = firstExisting.size () ? firstExisting.size () : first->countActiveNestedConstraints ();
2189
+ existingOperatorBindingsForDisjunction (*cs, second->getNestedConstraints (), secondExisting);
2190
+ secondFavored = secondExisting.size () ? secondExisting.size () : second->countActiveNestedConstraints ();
2191
+
2192
+ return firstFavored < secondFavored;
2193
+ } else {
2194
+ firstFavored = firstFavored ? firstFavored : first->countActiveNestedConstraints ();
2195
+ secondFavored = secondFavored ? secondFavored : second->countActiveNestedConstraints ();
2196
+ return firstFavored < secondFavored;
2197
+ }
2198
+ });
2200
2199
2201
2200
if (minDisjunction != disjunctions.end ())
2202
2201
return *minDisjunction;
0 commit comments