From b9bfcaad5dc6a780750b87824e08ad69bdfe1518 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Mon, 3 Apr 2023 18:29:57 +0200
Subject: [PATCH] Block+bytecode: minor simplification

---
 src/ModelTree.hh | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/ModelTree.hh b/src/ModelTree.hh
index 7098c0d6..ddf72dc1 100644
--- a/src/ModelTree.hh
+++ b/src/ModelTree.hh
@@ -1756,7 +1756,7 @@ ModelTree::writeBlockBytecodeHelper(BytecodeWriter &code_file, int block) const
             vector<vector<tuple<int, int, int>>> Uf(symbol_table.endo_nbr());
 
             for (int count_u {block_mfs};
-                 const auto &[indices, ignore] : blocks_derivatives[block])
+                 const auto &[indices, d1] : blocks_derivatives[block])
               {
                 const auto &[eq, var, lag] {indices};
                 int eqr {getBlockEquationID(block, eq)};
@@ -1769,11 +1769,7 @@ ModelTree::writeBlockBytecodeHelper(BytecodeWriter &code_file, int block) const
                               || simulation_type == BlockSimulationType::solveBackwardComplete))
                         continue;
                     code_file << FNUMEXPR_{ExpressionType::FirstEndoDerivative, eqr, varr, lag};
-                    if (auto it { blocks_derivatives[block].find({ eq, var, lag }) };
-                        it != blocks_derivatives[block].end())
-                      it->second->writeBytecodeOutput(code_file, output_type, temporary_terms_union, blocks_temporary_terms_idxs, tef_terms);
-                    else
-                      code_file << FLDZ_{};
+                    d1->writeBytecodeOutput(code_file, output_type, temporary_terms_union, blocks_temporary_terms_idxs, tef_terms);
                     if constexpr(dynamic)
                       code_file << FSTPU_{count_u};
                     else
-- 
GitLab