3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-08 00:05:46 +00:00

remove a bunch of constructors to avoid copies

still not enough to guarantee that vector::expand doesnt copy (WIP)
This commit is contained in:
Nuno Lopes 2020-06-03 17:09:27 +01:00
parent 98b5abb1d4
commit 7ac2791482
16 changed files with 66 additions and 83 deletions

View file

@ -16,8 +16,8 @@ Author:
Revision History:
--*/
#ifndef HASHTABLE_H_
#define HASHTABLE_H_
#pragma once
#include "util/debug.h"
#include <ostream>
#include "util/util.h"
@ -269,6 +269,19 @@ public:
m_st_collision = 0;
});
}
core_hashtable(core_hashtable && source) noexcept :
HashProc(source),
EqProc(source),
m_table(nullptr) {
m_capacity = source.m_capacity;
std::swap(m_table, source.m_table);
m_size = source.m_size;
m_num_deleted = 0;
HS_CODE({
m_st_collision = 0;
});
}
~core_hashtable() {
delete_table();
@ -736,6 +749,3 @@ public:
EqProc const & e = EqProc()):
core_hashtable<int_hash_entry<INT_MIN, INT_MIN + 1>, HashProc, EqProc>(initial_capacity, h, e) {}
};
#endif /* HASHTABLE_H_ */