mirror of
https://github.com/Z3Prover/z3
synced 2026-05-25 11:26:21 +00:00
simplify: replace custom reset_unsafe RAII struct with on_scope_exit
In solve_eqs::reduce(), the hand-rolled reset_unsafe struct was the only user-visible pattern in the codebase for scope-exit cleanup. Replace it with the project's existing on_scope_exit<> utility from util/util.h (already available via transitive includes), which is designed exactly for this purpose. Behavior is identical. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
51cbbe0a0e
commit
a23d2b7884
1 changed files with 1 additions and 6 deletions
|
|
@ -244,12 +244,7 @@ namespace euf {
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
vector<dependent_expr> old_fmls;
|
vector<dependent_expr> old_fmls;
|
||||||
dep_eq_vector eqs;
|
dep_eq_vector eqs;
|
||||||
struct reset_unsafe {
|
auto _reset_unsafe = on_scope_exit([&]() { m_unsafe_vars.reset(); });
|
||||||
solve_eqs& s;
|
|
||||||
reset_unsafe(solve_eqs& s): s(s) {}
|
|
||||||
~reset_unsafe() { s.m_unsafe_vars.reset(); }
|
|
||||||
};
|
|
||||||
reset_unsafe ru(*this);
|
|
||||||
do {
|
do {
|
||||||
old_fmls.reset();
|
old_fmls.reset();
|
||||||
m_subst_ids.reset();
|
m_subst_ids.reset();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue