mirror of
https://github.com/Z3Prover/z3
synced 2026-04-30 23:53:44 +00:00
Eliminate unnecessary copies with std::move for ref-counted types (#8591)
This commit is contained in:
parent
83b60990b1
commit
cc7e6cd92d
9 changed files with 12 additions and 14 deletions
|
|
@ -81,7 +81,7 @@ namespace smt {
|
|||
app * eq = m.mk_eq(arg1, arg2);
|
||||
app_ref neq(m.mk_not(eq), m);
|
||||
if (std::find(lits.begin(), lits.end(), neq.get()) == lits.end()) {
|
||||
lits.push_back(neq);
|
||||
lits.push_back(std::move(neq));
|
||||
prs.push_back(mk_hypothesis(m, eq, false, arg1, arg2));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ namespace smt {
|
|||
break;
|
||||
expr_ref lit(g2l.to());
|
||||
lit = g2l(t->get_literal().get());
|
||||
cube.push_back(lit);
|
||||
cube.push_back(std::move(lit));
|
||||
t = t->parent();
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -161,9 +161,8 @@ namespace smt {
|
|||
*/
|
||||
void theory_recfun::disable_guard(expr* guard, expr_ref_vector const& guards) {
|
||||
SASSERT(!is_enabled_guard(guard));
|
||||
app_ref dlimit = m_util.mk_num_rounds_pred(m_num_rounds);
|
||||
expr_ref_vector core(m);
|
||||
core.push_back(dlimit);
|
||||
core.push_back(m_util.mk_num_rounds_pred(m_num_rounds));
|
||||
core.push_back(guard);
|
||||
if (!m_guard2pending.contains(guard)) {
|
||||
m_disabled_guards.push_back(guard);
|
||||
|
|
@ -418,7 +417,7 @@ namespace smt {
|
|||
if (u().has_rec_defs() || !m_disabled_guards.empty()) {
|
||||
app_ref dlimit = m_util.mk_num_rounds_pred(m_num_rounds);
|
||||
TRACEFN("add_theory_assumption " << dlimit);
|
||||
assumptions.push_back(dlimit);
|
||||
assumptions.push_back(std::move(dlimit));
|
||||
for (expr* e : m_disabled_guards)
|
||||
assumptions.push_back(m.mk_not(e));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3350,7 +3350,7 @@ void theory_seq::add_theory_assumptions(expr_ref_vector & assumptions) {
|
|||
expr_ref dlimit = m_sk.mk_max_unfolding_depth(m_max_unfolding_depth);
|
||||
m_trail_stack.push(value_trail<literal>(m_max_unfolding_lit));
|
||||
m_max_unfolding_lit = mk_literal(dlimit);
|
||||
assumptions.push_back(dlimit);
|
||||
assumptions.push_back(std::move(dlimit));
|
||||
for (auto const& kv : m_length_limit_map) {
|
||||
if (kv.m_value > 0)
|
||||
assumptions.push_back(m_sk.mk_length_limit(kv.m_key, kv.m_value));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue