@@ -202,18 +202,6 @@ class SolverStep {
202
202
return StepResult::unsolved (followup);
203
203
}
204
204
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
-
217
205
void recordDisjunctionChoice (ConstraintLocator *disjunctionLocator,
218
206
unsigned index) const {
219
207
CS.recordDisjunctionChoice (disjunctionLocator, index);
@@ -915,10 +903,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
915
903
916
904
// / Conjunction constraint associated with this step.
917
905
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;
922
906
923
907
// / Indicates that one of the elements failed inference.
924
908
bool HadFailure = false ;
@@ -946,7 +930,7 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
946
930
conjunction->isIsolated () ? IsolatedSolutions : solutions),
947
931
BestScore(getBestScore()),
948
932
OuterScopeCount(cs.CountScopes, 0 ), Conjunction(conjunction),
949
- AfterConjunction(erase(conjunction)), OuterSolutions(solutions) {
933
+ OuterSolutions(solutions) {
950
934
assert (conjunction->getKind () == ConstraintKind::Conjunction);
951
935
952
936
// Make a snapshot of the constraint system state before conjunction.
@@ -965,9 +949,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
965
949
// Return all of the type variables and constraints back.
966
950
Snapshot.reset ();
967
951
968
- // Restore conjunction constraint.
969
- restore (AfterConjunction, Conjunction);
970
-
971
952
// Restore best score only if conjunction fails because
972
953
// successful outcome should keep a score set by `restoreOuterState`.
973
954
if (HadFailure)
0 commit comments