api: Remove redundant check in Term::toString(). (#7866)
authorAina Niemetz <aina.niemetz@gmail.com>
Tue, 4 Jan 2022 01:00:06 +0000 (17:00 -0800)
committerGitHub <noreply@github.com>
Tue, 4 Jan 2022 01:00:06 +0000 (01:00 +0000)
src/api/cpp/cvc5.cpp
test/unit/api/cpp/term_black.cpp

index 423b09cec018f47ffd60697075356df457c6580d..eaea15b765200539ba2c35f19468b8b5234f5f3a 100644 (file)
@@ -2679,10 +2679,6 @@ std::string Term::toString() const
 {
   CVC5_API_TRY_CATCH_BEGIN;
   //////// all checks before this line
-  if (d_solver != nullptr)
-  {
-    return d_node->toString();
-  }
   return d_node->toString();
   ////////
   CVC5_API_TRY_CATCH_END;
index bb57612b221f758b6e7c0a9e5d5c75716097066d..dc0d5fd43102464092308216c91ac35eea186d02 100644 (file)
@@ -1126,5 +1126,7 @@ TEST_F(TestApiBlackTerm, termScopedToString)
   Solver solver2;
   ASSERT_EQ(x.toString(), "x");
 }
+
+TEST_F(TestApiBlackTerm, toString) { ASSERT_NO_THROW(Term().toString()); }
 }  // namespace test
 }  // namespace cvc5