diff --git a/lib/Solver/Z3Solver.cpp b/lib/Solver/Z3Solver.cpp index 38b29f1da..37d8847a4 100644 --- a/lib/Solver/Z3Solver.cpp +++ b/lib/Solver/Z3Solver.cpp @@ -177,10 +177,10 @@ Result Z3Solver::hasValidConfigurations() { Result> Z3Solver::getNextConfiguration() { - if (!Dirty) { - Dirty = true; - } else { + if (Dirty) { excludeCurrentConfiguration(); + } else { + Dirty = true; } return getCurrentConfiguration(); @@ -241,7 +241,7 @@ Result Z3Solver::excludeCurrentConfiguration() { } const z3::model M = Solver->get_model(); z3::expr Expr = Context.bool_val(false); - for (auto const &Entry : OptionToVariableMapping) { + for (const auto &Entry : OptionToVariableMapping) { const z3::expr OptionExpr = *Entry.getValue(); const z3::expr Value = M.eval(OptionExpr, true); if (Value.is_bool()) { @@ -266,7 +266,7 @@ Z3Solver::getCurrentConfiguration() { const z3::model M = Solver->get_model(); auto Config = std::make_unique(); - for (auto const &Entry : OptionToVariableMapping) { + for (const auto &Entry : OptionToVariableMapping) { const z3::expr OptionExpr = *Entry.getValue(); const z3::expr Value = M.eval(OptionExpr, true); Config->setConfigurationOption(Entry.getKey(),