mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Constraint system] Turn explicit loop into std::any_of.
This commit is contained in:
@@ -700,18 +700,14 @@ bool ConstraintGraph::contractEdges() {
|
||||
// being present in this case, so it can generate the appropriate lvalue
|
||||
// wrapper for the argument type.
|
||||
if (isParamBindingConstraint) {
|
||||
auto node = tyvar1->getImpl().getGraphNode();
|
||||
auto hasDependentConstraint = false;
|
||||
|
||||
for (auto t1Constraint : node->getConstraints()) {
|
||||
if (isStrictInoutSubtypeConstraint(t1Constraint)) {
|
||||
hasDependentConstraint = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDependentConstraint)
|
||||
auto *node = tyvar1->getImpl().getGraphNode();
|
||||
auto constraints = node->getConstraints();
|
||||
if (std::any_of(constraints.begin(), constraints.end(),
|
||||
[](Constraint *constraint) {
|
||||
return isStrictInoutSubtypeConstraint(constraint);
|
||||
})) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
auto rep1 = CS.getRepresentative(tyvar1);
|
||||
|
||||
Reference in New Issue
Block a user