Skip to content

Commit

Permalink
fixed move assignment for VariableIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-hauns committed Dec 12, 2024
1 parent 1ed353a commit 37fae7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Kernel/Term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ bool TermList::isSafe() const
}

bool TermList::ground() const
{ return !isVar() && term()->ground(); }
{ return isTerm() && term()->ground(); }

/**
* Return true if @b ss and @b tt have the same top symbols, that is,
Expand Down
8 changes: 4 additions & 4 deletions Kernel/TermIterators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class VariableIterator
DECL_ELEMENT_TYPE(TermList);
VariableIterator() : _stack(8), _used(false) {}

VariableIterator& operator=(VariableIterator&&) = default;
VariableIterator(VariableIterator&& other)
: VariableIterator()
{
void swap(VariableIterator& other) {
std::swap(_stack, other._stack);
std::swap(_used, other._used);
std::swap(_aux[0], other._aux[0]);
Expand All @@ -59,6 +56,9 @@ class VariableIterator
}
}

VariableIterator& operator=(VariableIterator&& other) { swap(other); return *this; }
VariableIterator(VariableIterator&& other) : VariableIterator() { swap(other); }

VariableIterator(const Term* term) : _stack(8), _used(false)
{
if(term->isLiteral() && static_cast<const Literal*>(term)->isTwoVarEquality()){
Expand Down

0 comments on commit 37fae7d

Please sign in to comment.