mirror of
https://github.com/Z3Prover/z3
synced 2026-07-18 21:15:47 +00:00
Remove unused swap() methods (#8538)
This commit is contained in:
parent
56db8d5e98
commit
c0be7ac621
8 changed files with 17 additions and 24 deletions
|
|
@ -52,8 +52,8 @@ public:
|
|||
inc_ref();
|
||||
}
|
||||
|
||||
obj_ref(obj_ref && other) noexcept : m_obj(nullptr), m_manager(other.m_manager) {
|
||||
std::swap(m_obj, other.m_obj);
|
||||
obj_ref(obj_ref && other) noexcept : m_obj(other.m_obj), m_manager(other.m_manager) {
|
||||
other.m_obj = nullptr;
|
||||
}
|
||||
|
||||
~obj_ref() { dec_ref(); }
|
||||
|
|
@ -95,8 +95,11 @@ public:
|
|||
|
||||
obj_ref & operator=(obj_ref && n) noexcept {
|
||||
SASSERT(&m_manager == &n.m_manager);
|
||||
std::swap(m_obj, n.m_obj);
|
||||
n.reset();
|
||||
if (this != &n) {
|
||||
dec_ref();
|
||||
m_obj = n.m_obj;
|
||||
n.m_obj = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue