3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

remove using insert_if_not_there2

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-25 15:08:51 -07:00
parent 9ea1cf3c5c
commit a884201d62
47 changed files with 172 additions and 208 deletions

View file

@ -52,7 +52,7 @@ void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::e
for (unsigned i = 0; i < num_bindings; i++)
new_key->m_bindings[i] = bindings[i]->get_owner();
instances::entry * entry = m_instances.insert_if_not_there2(new_key, nullptr);
auto* entry = m_instances.insert_if_not_there3(new_key, nullptr);
if (entry->get_data().m_key != new_key) {
SASSERT(entry->get_data().m_value != 0);
// entry was already there

View file

@ -201,6 +201,10 @@ namespace smt {
return m_root;
}
bool is_root() const {
return m_root == this;
}
void set_root(enode* r) {
m_root = r;
}

View file

@ -58,7 +58,7 @@ namespace {
void partition_terms(unsigned num_terms, expr* const* terms, sort2term_ids& termids) {
for (unsigned i = 0; i < num_terms; ++i) {
sort* s = m.get_sort(terms[i]);
term_ids& vec = termids.insert_if_not_there2(s, term_ids())->get_data().m_value;
term_ids& vec = termids.insert_if_not_there(s, term_ids());
vec.push_back(term_id(expr_ref(terms[i],m), i));
}
}
@ -208,7 +208,7 @@ namespace {
continue;
}
vals.push_back(vl);
unsigned_vector& vec = vals_map.insert_if_not_there2(vl, unsigned_vector())->get_data().m_value;
unsigned_vector& vec = vals_map.insert_if_not_there(vl, unsigned_vector());
bool found = false;
for (unsigned j = 0; !found && j < vec.size(); ++j) {

View file

@ -132,7 +132,7 @@ namespace smt {
return false;
}
else {
m_coeff_map.insert_if_not_there2(e, rational(0))->get_data().m_value += mul;
m_coeff_map.insert_if_not_there(e, rational(0)) += mul;
}
}
for (auto const& kv : m_coeff_map) {