mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
remove unneeded iterator functions
This commit is contained in:
parent
737c2208fa
commit
499ed5d844
32 changed files with 27 additions and 87 deletions
|
@ -61,8 +61,7 @@ namespace euf {
|
|||
node* operator*() { return m_first; }
|
||||
iterator& operator++() { if (!m_last) m_last = m_first; m_first = m_first->next; return *this; }
|
||||
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
|
||||
bool operator==(iterator const& other) const { return m_last == other.m_last && m_first == other.m_first; }
|
||||
bool operator!=(iterator const& other) const { return !(*this == other); }
|
||||
bool operator!=(iterator const& other) const { return m_last != other.m_last || m_first != other.m_first; }
|
||||
};
|
||||
equiv(node& _n) :n(_n) {}
|
||||
equiv(node* _n) :n(*_n) {}
|
||||
|
|
|
@ -280,8 +280,7 @@ namespace euf {
|
|||
enode* operator*() { return m_first; }
|
||||
iterator& operator++() { if (!m_last) m_last = m_first; m_first = m_first->m_next; return *this; }
|
||||
iterator operator++(int) { iterator tmp = *this; ++*this; return tmp; }
|
||||
bool operator==(iterator const& other) const { return m_last == other.m_last && m_first == other.m_first; }
|
||||
bool operator!=(iterator const& other) const { return !(*this == other); }
|
||||
bool operator!=(iterator const& other) const { return m_last != other.m_last || m_first != other.m_first; }
|
||||
};
|
||||
enode_class(enode & _n):n(_n) {}
|
||||
enode_class(enode * _n):n(*_n) {}
|
||||
|
@ -300,8 +299,7 @@ namespace euf {
|
|||
th_var_list const& operator*() { return *m_th_vars; }
|
||||
iterator& operator++() { m_th_vars = m_th_vars->get_next(); return *this; }
|
||||
iterator operator++(int) { iterator tmp = *this; ++* this; return tmp; }
|
||||
bool operator==(iterator const& other) const { return m_th_vars == other.m_th_vars; }
|
||||
bool operator!=(iterator const& other) const { return !(*this == other); }
|
||||
bool operator!=(iterator const& other) const { return m_th_vars != other.m_th_vars; }
|
||||
};
|
||||
enode_th_vars(enode& _n) :n(_n) {}
|
||||
enode_th_vars(enode* _n) :n(*_n) {}
|
||||
|
|
|
@ -146,20 +146,16 @@ subterms::iterator& subterms::iterator::operator++() {
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool subterms::iterator::operator==(iterator const& other) const {
|
||||
bool subterms::iterator::operator!=(iterator const& other) const {
|
||||
// ignore state of visited
|
||||
if (other.m_esp->size() != m_esp->size()) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
for (unsigned i = m_esp->size(); i-- > 0; ) {
|
||||
if (m_esp->get(i) != other.m_esp->get(i))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool subterms::iterator::operator!=(iterator const& other) const {
|
||||
return !(*this == other);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -216,18 +212,14 @@ subterms_postorder::iterator& subterms_postorder::iterator::operator++() {
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool subterms_postorder::iterator::operator==(iterator const& other) const {
|
||||
bool subterms_postorder::iterator::operator!=(iterator const& other) const {
|
||||
// ignore state of visited
|
||||
if (other.m_es.size() != m_es.size()) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
for (unsigned i = m_es.size(); i-- > 0; ) {
|
||||
if (m_es.get(i) != other.m_es.get(i))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool subterms_postorder::iterator::operator!=(iterator const& other) const {
|
||||
return !(*this == other);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -190,7 +190,6 @@ public:
|
|||
expr* operator*();
|
||||
iterator operator++(int);
|
||||
iterator& operator++();
|
||||
bool operator==(iterator const& other) const;
|
||||
bool operator!=(iterator const& other) const;
|
||||
};
|
||||
|
||||
|
@ -220,7 +219,6 @@ public:
|
|||
expr* operator*();
|
||||
iterator operator++(int);
|
||||
iterator& operator++();
|
||||
bool operator==(iterator const& other) const;
|
||||
bool operator!=(iterator const& other) const;
|
||||
};
|
||||
static subterms_postorder all(expr_ref_vector const& es) { return subterms_postorder(es, true); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue