mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
get rid of m_resize_buffer
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
2975873b91
commit
98dfb1ba86
1 changed files with 7 additions and 8 deletions
|
@ -25,7 +25,6 @@ namespace lp {
|
|||
// serves at a set of non-negative integers smaller than the set size
|
||||
class int_set {
|
||||
svector<int> m_data;
|
||||
svector<int> m_resize_buffer;
|
||||
unsigned_vector m_index;
|
||||
|
||||
public:
|
||||
|
@ -33,7 +32,6 @@ public:
|
|||
int_set() {}
|
||||
int_set(int_set const& other):
|
||||
m_data(other.m_data),
|
||||
m_resize_buffer(other.m_resize_buffer),
|
||||
m_index(other.m_index) {}
|
||||
|
||||
bool contains(unsigned j) const {
|
||||
|
@ -65,13 +63,14 @@ public:
|
|||
|
||||
void resize(unsigned size) {
|
||||
if (size < data_size()) {
|
||||
for (unsigned j: m_index) {
|
||||
if (j > size)
|
||||
m_resize_buffer.push_back(j);
|
||||
unsigned i = 0;
|
||||
for (unsigned j : m_index) {
|
||||
if (j < size) {
|
||||
m_data[j] = i;
|
||||
m_index[i++] = j;
|
||||
}
|
||||
}
|
||||
for (unsigned j : m_resize_buffer)
|
||||
erase(j);
|
||||
m_resize_buffer.clear();
|
||||
m_index.shrink(i);
|
||||
}
|
||||
m_data.resize(size, -1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue