From 3d21821d0c4aa24066c3c4ed596ea19e41c7cd78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 5 Jul 2022 15:54:52 +0200
Subject: [PATCH] =?UTF-8?q?JSON=20output:=20remove=20duplicate=20=E2=80=9C?=
 =?UTF-8?q?rhs=E2=80=9D=20field=20when=20RHS=20of=20equation=20is=20non-ze?=
 =?UTF-8?q?ro=20constant?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/ModelTree.cc | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index f6d33384..8d8df52b 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1707,21 +1707,7 @@ ModelTree::writeJsonModelEquations(ostream &output, bool residuals) const
 
           output << R"(, "rhs": ")";
           rhs->writeJsonOutput(output, {}, {});
-          output << R"(")";
-          try
-            {
-              // Test if the right hand side of the equation is empty.
-              if (rhs->eval({}) != 0)
-                {
-                  output << R"(, "rhs": ")";
-                  rhs->writeJsonOutput(output, {}, {});
-                  output << R"(")";
-                }
-            }
-          catch (ExprNode::EvalException &e)
-            {
-            }
-          output << "}";
+          output << R"("})";
         }
       else
         {
-- 
GitLab