Skip to content

Commit c63edac

Browse files
authored
Merge pull request #11906 from rudkx/edge-contraction
[Constraint system] Turn explicit loop into llvm::any_of.
2 parents 1248faa + 8563911 commit c63edac

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lib/Sema/ConstraintGraph.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -700,18 +700,13 @@ bool ConstraintGraph::contractEdges() {
700700
// being present in this case, so it can generate the appropriate lvalue
701701
// wrapper for the argument type.
702702
if (isParamBindingConstraint) {
703-
auto node = tyvar1->getImpl().getGraphNode();
704-
auto hasDependentConstraint = false;
705-
706-
for (auto t1Constraint : node->getConstraints()) {
707-
if (isStrictInoutSubtypeConstraint(t1Constraint)) {
708-
hasDependentConstraint = true;
709-
break;
710-
}
711-
}
712-
713-
if (hasDependentConstraint)
703+
auto *node = tyvar1->getImpl().getGraphNode();
704+
auto constraints = node->getConstraints();
705+
if (llvm::any_of(constraints, [](Constraint *constraint) {
706+
return isStrictInoutSubtypeConstraint(constraint);
707+
})) {
714708
continue;
709+
}
715710
}
716711

717712
auto rep1 = CS.getRepresentative(tyvar1);

0 commit comments

Comments
 (0)