mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 02:45:51 +00:00
remove unnecessary parameter copies
This commit is contained in:
parent
ab22e763d7
commit
cab3c45863
9 changed files with 23 additions and 34 deletions
|
@ -48,21 +48,13 @@ parameter::~parameter() {
|
|||
}
|
||||
}
|
||||
|
||||
parameter& parameter::operator=(parameter const& other) {
|
||||
if (this == &other) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
this->~parameter();
|
||||
m_val = other.m_val;
|
||||
|
||||
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);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void parameter::init_eh(ast_manager & m) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue