From be15e064dce264c99b61b9d119d7567cf3742fb6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 6 Nov 2024 15:40:52 +0100
Subject: [PATCH] Minor simplifications related to booleans

---
 src/DynamicModel.cc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc
index d0e2e15f..9f8e5af1 100644
--- a/src/DynamicModel.cc
+++ b/src/DynamicModel.cc
@@ -1359,8 +1359,7 @@ DynamicModel::fillVarModelTableFromOrigModel() const
           // save lhs variables
           equations[eqn]->arg1->collectVARLHSVariable(lhs);
 
-          equations[eqn]->arg1->countDiffs() > 0 ? diff_vec.push_back(true)
-                                                 : diff_vec.push_back(false);
+          diff_vec.push_back(equations[eqn]->arg1->countDiffs() > 0);
           if (diff_vec.back())
             {
               set<pair<int, int>> diff_set;
@@ -1704,10 +1703,7 @@ DynamicModel::fillTrendComponentModelTableFromOrigModel() const
           // save lhs variables
           equations[eqn]->arg1->collectVARLHSVariable(lhs);
 
-          if (equations[eqn]->arg1->countDiffs() > 0)
-            diff_vec.push_back(true);
-          else
-            diff_vec.push_back(false);
+          diff_vec.push_back(equations[eqn]->arg1->countDiffs() > 0);
           if (diff_vec.back())
             {
               set<pair<int, int>> diff_set;
@@ -1780,7 +1776,7 @@ DynamicModel::getUndiffLHSForPac(const string& aux_model_name,
           exit(EXIT_FAILURE);
         }
 
-      if (diff.at(i) != true)
+      if (!diff.at(i))
         {
           cerr << "ERROR: the variable on the LHS of equation #" << eqn
                << " does not have the diff operator applied to it yet you are trying to undiff it."
-- 
GitLab