3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +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

@ -105,14 +105,14 @@ namespace datalog {
void relation_manager::store_relation(func_decl * pred, relation_base * rel) {
SASSERT(rel);
relation_map::obj_map_entry * e = m_relations.insert_if_not_there2(pred, 0);
if (e->get_data().m_value) {
e->get_data().m_value->deallocate();
auto& value = m_relations.insert_if_not_there(pred, 0);
if (value) {
value->deallocate();
}
else {
get_context().get_manager().inc_ref(pred); //dec_ref in reset
}
e->get_data().m_value = rel;
value = rel;
}
decl_set relation_manager::collect_predicates() const {