mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Constraint graph] Move constraint uniquing into gatherConstraints().
Simplify the interface to gatherConstraints() by performing the uniquing within the function itself and returning only the resulting (uniqued) vector of constraints.
This commit is contained in:
@@ -7133,9 +7133,8 @@ ConstraintSystem::addKeyPathApplicationRootConstraint(Type root, ConstraintLocat
|
||||
if (!typeVar)
|
||||
return;
|
||||
|
||||
llvm::SetVector<Constraint *> constraints;
|
||||
CG.gatherConstraints(
|
||||
typeVar, constraints, ConstraintGraph::GatheringKind::EquivalenceClass,
|
||||
auto constraints = CG.gatherConstraints(
|
||||
typeVar, ConstraintGraph::GatheringKind::EquivalenceClass,
|
||||
[&keyPathExpr](Constraint *constraint) -> bool {
|
||||
return constraint->getKind() == ConstraintKind::KeyPath &&
|
||||
constraint->getLocator()->getAnchor() == keyPathExpr;
|
||||
|
||||
Reference in New Issue
Block a user