3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

create insert-fresh and insert for indexed_uint_set to make use cases with non-fresh inserts easier

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-08-03 09:48:07 -07:00
parent 0478ab1498
commit 7b36563196
5 changed files with 13 additions and 8 deletions

View file

@ -318,7 +318,7 @@ public:
m_size(0)
{}
void insert(unsigned x) {
void insert_fresh(unsigned x) {
SASSERT(!contains(x));
m_index.reserve(x + 1, UINT_MAX);
m_elems.reserve(m_size + 1);
@ -327,6 +327,11 @@ public:
m_size++;
SASSERT(contains(x));
}
void insert(unsigned x) {
if (!contains(x))
insert_fresh(x);
}
void remove(unsigned x) {
SASSERT(contains(x));