3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

fix local search

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-03-14 13:47:01 -07:00
parent 51951a3683
commit 5c6cef4735
3 changed files with 81 additions and 37 deletions

View file

@ -344,11 +344,12 @@ public:
void insert(unsigned x) {
SASSERT(!contains(x));
m_index.resize(x + 1, UINT_MAX);
m_elems.resize(m_size + 1);
m_index.reserve(x + 1, UINT_MAX);
m_elems.reserve(m_size + 1);
m_index[x] = m_size;
m_elems[m_size] = x;
m_size++;
SASSERT(contains(x));
}
void remove(unsigned x) {
@ -361,6 +362,7 @@ public:
m_index[x] = m_size;
m_elems[m_size] = x;
}
SASSERT(!contains(x));
}
bool contains(unsigned x) const { return x < m_index.size() && m_index[x] < m_size && m_elems[m_index[x]] == x; }