Skip to content

Commit d7f4fff

Browse files
Correcting next_sibling_or_parent on iterators
1 parent ea3e8e9 commit d7f4fff

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/util/expr_iterator.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ inline bool operator==(
5555
const depth_iterator_expr_statet &right)
5656
{ return left.it==right.it && left.expr.get()==right.expr.get(); }
5757

58-
5958
/// Depth first search iterator base - iterates over supplied expression
6059
/// and all its operands recursively.
6160
/// Base class using CRTP
@@ -100,14 +99,8 @@ class depth_iterator_baset
10099
depth_iterator_t &next_sibling_or_parent()
101100
{
102101
PRECONDITION(!m_stack.empty());
103-
while(!m_stack.empty())
104-
{
105-
m_stack.back().it++;
106-
if(m_stack.back().it==m_stack.back().end)
107-
m_stack.pop_back();
108-
else if(this->downcast().push_expr(*m_stack.back().it))
109-
break;
110-
}
102+
m_stack.back().it=m_stack.back().end;
103+
++(*this);
111104
return this->downcast();
112105
}
113106

0 commit comments

Comments
 (0)