Skip to content

Commit 85f7ddd

Browse files
authored
Merge pull request swiftlang#5783 from rudkx/minor-simplification
Remove extra calls to getRepresentative().
2 parents a62da84 + 3ff07ab commit 85f7ddd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -979,14 +979,8 @@ static PotentialBindings getPotentialBindings(ConstraintSystem &cs,
979979
auto first = cs.simplifyType(constraint->getFirstType());
980980
auto second = cs.simplifyType(constraint->getSecondType());
981981

982-
if (auto firstTyvar = first->getAs<TypeVariableType>()) {
983-
if (auto secondTyvar = second->getAs<TypeVariableType>()) {
984-
if (cs.getRepresentative(firstTyvar) ==
985-
cs.getRepresentative(secondTyvar)) {
986-
continue;
987-
}
988-
}
989-
}
982+
if (first->is<TypeVariableType>() && first->isEqual(second))
983+
continue;
990984

991985
Type type;
992986
AllowedBindingKind kind;

0 commit comments

Comments
 (0)