mirror of
https://github.com/Z3Prover/z3
synced 2026-03-18 19:14:29 +00:00
Store rational by value in parameter variant (#8518)
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
This commit is contained in:
parent
e73c897bd4
commit
3a8b688008
2 changed files with 4 additions and 10 deletions
|
|
@ -41,18 +41,12 @@ Revision History:
|
|||
// -----------------------------------
|
||||
|
||||
parameter::~parameter() {
|
||||
if (auto p = std::get_if<rational*>(&m_val)) {
|
||||
dealloc(*p);
|
||||
}
|
||||
if (auto p = std::get_if<zstring*>(&m_val)) {
|
||||
dealloc(*p);
|
||||
}
|
||||
}
|
||||
|
||||
parameter::parameter(parameter const& other) : m_val(other.m_val) {
|
||||
if (auto p = std::get_if<rational*>(&m_val)) {
|
||||
m_val = alloc(rational, **p);
|
||||
}
|
||||
if (auto p = std::get_if<zstring*>(&m_val)) {
|
||||
m_val = alloc(zstring, **p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue