3
0
Fork 0
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:
Copilot 2026-02-08 18:53:43 +00:00 committed by GitHub
parent 56db8d5e98
commit c0be7ac621
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 17 additions and 24 deletions

View file

@ -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;
}