Skip to content

Commit 001bbda

Browse files
committed
Fix overload set construction to not have an extra element in the disjunction.
Any time we had a favored choice for a disjunction, we attempted to not add it twice, but that little optimization was faulty. This should speed up some expression type checking a tiny bit in cases where the favored choice did not result in a solution. Noticed by observation.
1 parent 1a87a8c commit 001bbda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ void ConstraintSystem::addOverloadSet(Type boundType,
14331433
overloads.push_back(bindOverloadConstraint);
14341434
}
14351435

1436-
for (auto choice : choices) {
1436+
for (auto &choice : choices) {
14371437
if (favoredChoice && (favoredChoice == &choice))
14381438
continue;
14391439

0 commit comments

Comments
 (0)