From 6ad3d02ec6ce66a448b04939ad69ba723c104763 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 29 Oct 2021 15:10:57 +0200
Subject: [PATCH] Minor simplification in
 ExprNode::matchLinearCombinationOfVariables()

---
 src/ExprNode.cc | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/ExprNode.cc b/src/ExprNode.cc
index 3ecb5244..01aa71a6 100644
--- a/src/ExprNode.cc
+++ b/src/ExprNode.cc
@@ -8521,10 +8521,8 @@ ExprNode::matchLinearCombinationOfVariables(bool variable_obligatory_in_each_ter
 
   vector<tuple<int, int, int, double>> result;
 
-  for (const auto &it : terms)
+  for (auto [term, sign] : terms)
     {
-      expr_t term = it.first;
-      int sign = it.second;
       auto m = term->matchVariableTimesConstantTimesParam(variable_obligatory_in_each_term);
       get<3>(m) *= sign;
       result.push_back(m);
-- 
GitLab