@@ -202,18 +202,6 @@ class SolverStep {
202202 return StepResult::unsolved (followup);
203203 }
204204
205- // / Erase constraint from the constraint system (include constraint graph)
206- // / and return the constraint which follows it.
207- ConstraintList::iterator erase (Constraint *constraint) {
208- CS.CG .removeConstraint (constraint);
209- return CS.InactiveConstraints .erase (constraint);
210- }
211-
212- void restore (ConstraintList::iterator &iterator, Constraint *constraint) {
213- CS.InactiveConstraints .insert (iterator, constraint);
214- CS.CG .addConstraint (constraint);
215- }
216-
217205 void recordDisjunctionChoice (ConstraintLocator *disjunctionLocator,
218206 unsigned index) const {
219207 CS.recordDisjunctionChoice (disjunctionLocator, index);
@@ -915,10 +903,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
915903
916904 // / Conjunction constraint associated with this step.
917905 Constraint *Conjunction;
918- // / Position of the conjunction in the inactive constraints
919- // / list which is required to re-instate it to the system
920- // / after this step is done.
921- ConstraintList::iterator AfterConjunction;
922906
923907 // / Indicates that one of the elements failed inference.
924908 bool HadFailure = false ;
@@ -946,7 +930,7 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
946930 conjunction->isIsolated () ? IsolatedSolutions : solutions),
947931 BestScore(getBestScore()),
948932 OuterScopeCount(cs.CountScopes, 0 ), Conjunction(conjunction),
949- AfterConjunction(erase(conjunction)), OuterSolutions(solutions) {
933+ OuterSolutions(solutions) {
950934 assert (conjunction->getKind () == ConstraintKind::Conjunction);
951935
952936 // Make a snapshot of the constraint system state before conjunction.
@@ -965,9 +949,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
965949 // Return all of the type variables and constraints back.
966950 Snapshot.reset ();
967951
968- // Restore conjunction constraint.
969- restore (AfterConjunction, Conjunction);
970-
971952 // Restore best score only if conjunction fails because
972953 // successful outcome should keep a score set by `restoreOuterState`.
973954 if (HadFailure)
0 commit comments