3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-04 01:15:15 +00:00

move, dont copy

This commit is contained in:
Nuno Lopes 2026-02-09 19:41:26 +00:00 committed by Nikolaj Bjorner
parent fc6355cbe2
commit b7bf23c3bb
2 changed files with 7 additions and 4 deletions

View file

@ -636,6 +636,13 @@ public:
return *this; return *this;
} }
core_hashtable& operator=(core_hashtable && other) {
if (this == &other) return *this;
delete_table();
std::swap(*this, other);
return *this;
}
#ifdef Z3DEBUG #ifdef Z3DEBUG
bool check_invariant() { bool check_invariant() {
// The capacity must always be a power of two. // The capacity must always be a power of two.

View file

@ -34,10 +34,6 @@ public:
struct hash_proc { unsigned operator()(s_integer const& r) const { return r.hash(); } }; struct hash_proc { unsigned operator()(s_integer const& r) const { return r.hash(); } };
struct eq_proc { bool operator()(s_integer const& r1, s_integer const& r2) const { return r1 == r2; } }; struct eq_proc { bool operator()(s_integer const& r1, s_integer const& r2) const { return r1 == r2; } };
void swap(s_integer & n) noexcept {
std::swap(m_val, n.m_val);
}
std::string to_string() const; std::string to_string() const;
public: public: