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

remove unneeded iterator functions

This commit is contained in:
Nuno Lopes 2024-09-23 12:57:54 +01:00
parent 737c2208fa
commit 499ed5d844
32 changed files with 27 additions and 87 deletions

View file

@ -571,8 +571,7 @@ namespace dd {
pdd_monomial const* operator->() const { return &m_mono; }
pdd_iterator& operator++() { next(); return *this; }
pdd_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(pdd_iterator const& other) const { return m_nodes == other.m_nodes; }
bool operator!=(pdd_iterator const& other) const { return !operator==(other); }
bool operator!=(pdd_iterator const& other) const { return m_nodes != other.m_nodes; }
};
class pdd_linear_iterator {
@ -591,7 +590,6 @@ namespace dd {
pointer operator->() const { return &m_mono; }
pdd_linear_iterator& operator++() { next(); return *this; }
pdd_linear_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(pdd_linear_iterator const& other) const { return m_next == other.m_next; }
bool operator!=(pdd_linear_iterator const& other) const { return m_next != other.m_next; }
};

View file

@ -369,7 +369,6 @@ public:
}
iterator& operator++() { fwd(); return *this; }
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
bool operator==(iterator const& it) const {return m_count == it.m_count; }
bool operator!=(iterator const& it) const {return m_count != it.m_count; }
private:

View file

@ -455,7 +455,6 @@ public:
offset_t operator*() const { return p.m_passive[m_idx]; }
iterator& operator++() { ++m_idx; fwd(); return *this; }
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
};
@ -614,7 +613,6 @@ public:
offset_t sos() const { return (p.hb.vec(pas()).weight().is_pos()?p.m_neg_sos:p.m_pos_sos)[p.m_psos[m_idx]]; }
iterator& operator++() { ++m_idx; fwd(); return *this; }
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
};

View file

@ -115,7 +115,6 @@ class hilbert_basis {
offset_t operator*() const { return hb.m_basis[m_idx]; }
iterator& operator++() { ++m_idx; return *this; }
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
bool operator==(iterator const& it) const {return m_idx == it.m_idx; }
bool operator!=(iterator const& it) const {return m_idx != it.m_idx; }
};

View file

@ -51,9 +51,8 @@ class emonics {
unsigned m_index;
};
struct head_tail {
head_tail(): m_head(nullptr), m_tail(nullptr) {}
cell* m_head;
cell* m_tail;
cell* m_head = nullptr;
cell* m_tail = nullptr;
};
struct hash_canonical {
emonics& em;
@ -205,7 +204,6 @@ public:
monic & operator*() { return m.m_monics[m_cell->m_index]; }
iterator& operator++() { m_touched = true; m_cell = m_cell->m_next; return *this; }
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
bool operator==(iterator const& other) const { return m_cell == other.m_cell && m_touched == other.m_touched; }
bool operator!=(iterator const& other) const { return m_cell != other.m_cell || m_touched != other.m_touched; }
};
@ -239,7 +237,6 @@ public:
}
pf_iterator& operator++() { ++m_it; fast_forward(); return *this; }
pf_iterator operator++(int) { pf_iterator tmp = *this; ++*this; return tmp; }
bool operator==(pf_iterator const& other) const { return m_it == other.m_it; }
bool operator!=(pf_iterator const& other) const { return m_it != other.m_it; }
};

View file

@ -106,11 +106,10 @@ public:
iterator(bool run_on_vector, pair_vec::const_iterator vi, ci_set::iterator cii) :
m_run_on_vector(run_on_vector), m_vi(vi), m_ci(cii)
{}
bool operator==(const iterator &other) const {
bool operator!=(const iterator &other) const {
SASSERT(m_run_on_vector == other.m_run_on_vector);
return m_run_on_vector? m_vi == other.m_vi : m_ci == other.m_ci;
return m_run_on_vector ? m_vi != other.m_vi : m_ci != other.m_ci;
}
bool operator!=(const iterator &other) const { return !(*this == other); }
};
iterator begin() const {

View file

@ -97,14 +97,12 @@ const_iterator_mon::const_iterator_mon(const bool_vector& mask, const factorizat
m_ff(f) ,
m_full_factorization_returned(false)
{}
bool const_iterator_mon::operator==(const const_iterator_mon::self_type &other) const {
return
m_full_factorization_returned == other.m_full_factorization_returned &&
m_mask == other.m_mask;
}
bool const_iterator_mon::operator!=(const const_iterator_mon::self_type &other) const { return !(*this == other); }
bool const_iterator_mon::operator!=(const const_iterator_mon::self_type &other) const {
return
m_full_factorization_returned != other.m_full_factorization_returned ||
m_mask != other.m_mask;
}
factorization const_iterator_mon::create_binary_factorization(factor j, factor k) const {
factorization f(nullptr);

View file

@ -88,8 +88,7 @@ struct const_iterator_mon {
self_type operator++(int);
const_iterator_mon(const bool_vector& mask, const factorization_factory *f);
bool operator==(const self_type &other) const;
bool operator!=(const self_type &other) const;
factorization create_binary_factorization(factor j, factor k) const;

View file

@ -203,7 +203,6 @@ public:
lar_base_constraint const* operator->() const { return &cs[m_index]; }
iterator& operator++() { next(); return *this; }
iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(iterator const& other) const { return m_index == other.m_index; }
bool operator!=(iterator const& other) const { return m_index != other.m_index; }
};
iterator begin() const { return iterator(cs, 0); }
@ -229,7 +228,6 @@ public:
constraint_index const* operator->() const { return &m_index; }
iterator& operator++() { next(); return *this; }
iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(iterator const& other) const { return m_index == other.m_index; }
bool operator!=(iterator const& other) const { return m_index != other.m_index; }
};
iterator begin() const { return iterator(cs, 0); }

View file

@ -170,8 +170,7 @@ public:
const_iterator operator++() { const_iterator i = *this; m_it++; return i; }
const_iterator operator++(int) { m_it++; return *this; }
const_iterator(u_map<mpq>::iterator it) : m_it(it) {}
bool operator==(const const_iterator &other) const { return m_it == other.m_it; }
bool operator!=(const const_iterator &other) const { return !(*this == other); }
bool operator!=(const const_iterator &other) const { return m_it != other.m_it; }
};
bool is_normalized() const {

View file

@ -302,7 +302,6 @@ public:
return signed_var(m_idx);
}
iterator& operator++() { m_idx = m_ve.m_uf.next(m_idx); m_touched = true; return *this; }
bool operator==(iterator const& other) const { return m_idx == other.m_idx && m_touched == other.m_touched; }
bool operator!=(iterator const& other) const { return m_idx != other.m_idx || m_touched != other.m_touched; }
};

View file

@ -71,7 +71,6 @@ public:
unsigned const* operator->() const { return &m_column; }
col_iterator& operator++() { next(); return *this; }
col_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(col_iterator const& other) const { return m_column == other.m_column; }
bool operator!=(col_iterator const& other) const { return m_column != other.m_column; }
};
@ -88,7 +87,6 @@ public:
row* operator->() { return &m_row; }
row_iterator& operator++() { next(); return *this; }
row_iterator operator++(int) { auto tmp = *this; next(); return tmp; }
bool operator==(row_iterator const& other) const { return m_index == other.m_index; }
bool operator!=(row_iterator const& other) const { return m_index != other.m_index; }
};

View file

@ -198,7 +198,6 @@ namespace simplex {
row_entry * operator->() const { return &(operator*()); }
row_iterator & operator++() { ++m_curr; move_to_used(); return *this; }
row_iterator operator++(int) { row_iterator tmp = *this; ++*this; return tmp; }
bool operator==(row_iterator const & it) const { return m_curr == it.m_curr; }
bool operator!=(row_iterator const & it) const { return m_curr != it.m_curr; }
};
@ -308,7 +307,6 @@ namespace simplex {
row operator*() { return row(m_curr); }
all_row_iterator & operator++() { m_curr++; move_to_next(); return *this; }
all_row_iterator operator++(int) { all_row_iterator tmp = *this; ++*this; return tmp; }
bool operator==(all_row_iterator const& it) const { return m_curr == it.m_curr; }
bool operator!=(all_row_iterator const& it) const { return m_curr != it.m_curr; }
};