mirror of
https://github.com/Z3Prover/z3
synced 2026-02-10 11:00:52 +00:00
Replace manual pair unpacking with structured bindings (#8197)
* Initial plan * Apply structured bindings to enode_bool_pair usage Replace manual unpacking of pairs with C++17 structured bindings in: - src/ast/euf/euf_egraph.cpp - src/smt/smt_internalizer.cpp - src/smt/smt_context.cpp (2 locations) This improves code readability and reduces boilerplate code. Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
e7f9a31b25
commit
1bf463d77a
3 changed files with 7 additions and 11 deletions
|
|
@ -653,8 +653,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
if (parent->is_cgc_enabled()) {
|
||||
enode_bool_pair pair = m_cg_table.insert(parent);
|
||||
enode * parent_prime = pair.first;
|
||||
auto [parent_prime, used_commutativity] = m_cg_table.insert(parent);
|
||||
if (parent_prime == parent) {
|
||||
SASSERT(parent);
|
||||
SASSERT(parent->is_cgr());
|
||||
|
|
@ -665,7 +664,6 @@ namespace smt {
|
|||
parent->m_cg = parent_prime;
|
||||
SASSERT(!m_cg_table.contains_ptr(parent));
|
||||
if (parent_prime->m_root != parent->m_root) {
|
||||
bool used_commutativity = pair.second;
|
||||
TRACE(cg, tout << "found new congruence: #" << parent->get_owner_id() << " = #" << parent_prime->get_owner_id()
|
||||
<< " used_commutativity: " << used_commutativity << "\n";);
|
||||
push_new_congruence(parent, parent_prime, used_commutativity);
|
||||
|
|
@ -972,8 +970,8 @@ namespace smt {
|
|||
(parent == cg || // parent was root of the congruence class before and after the merge
|
||||
!congruent(parent, cg) // parent was root of the congruence class before but not after the merge
|
||||
)) {
|
||||
enode_bool_pair p = m_cg_table.insert(parent);
|
||||
parent->m_cg = p.first;
|
||||
auto [parent_cg, used_commutativity] = m_cg_table.insert(parent);
|
||||
parent->m_cg = parent_cg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue