Skip to content

Commit

Permalink
don't be silly to only create a TermList conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Suda committed Oct 26, 2023
1 parent 5b5658c commit 1808bdc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Kernel/TermTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Term* TermTransformer::transform(Term* term)
if(orig->isSort()){
//For most applications we probably dont want to transform sorts.
//However, we don't enforce that here, inheriting classes can decide
//for themselves
//for themselves
newTrm=AtomicSort::create(static_cast<AtomicSort*>(orig), argLst);
} else {
newTrm=Term::create(orig,argLst);
Expand Down Expand Up @@ -229,12 +229,7 @@ TermList TermTransformer::transform(TermList ts)
if (ts.isVar()) {
return transformSubterm(ts);
} else {
Term* transformed = transform(ts.term());
if (transformed != ts.term()) {
return TermList(transformed);
} else {
return ts;
}
return TermList(transform(ts.term()));
}
}

Expand Down

0 comments on commit 1808bdc

Please sign in to comment.