From c6a52fd778a0992e30427e3fb1686893e6936bee Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 21 Jan 2020 15:42:35 +0100
Subject: [PATCH] macro processor: c++ modernization

---
 src/macro/Environment.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/macro/Environment.cc b/src/macro/Environment.cc
index 822c03c6..25826a5f 100644
--- a/src/macro/Environment.cc
+++ b/src/macro/Environment.cc
@@ -43,8 +43,7 @@ Environment::define(FunctionPtr func, ExpressionPtr value)
 ExpressionPtr
 Environment::getVariable(const string &name) const
 {
-  auto it = variables.find(name);
-  if (it != variables.end())
+  if (auto it = variables.find(name); it != variables.end())
     return it->second;
 
   if (!parent)
@@ -56,8 +55,7 @@ Environment::getVariable(const string &name) const
 tuple<FunctionPtr, ExpressionPtr>
 Environment::getFunction(const string &name) const
 {
-  auto it = functions.find(name);
-  if (it != functions.end())
+  if (auto it = functions.find(name); it != functions.end())
     return it->second;
 
   if (!parent)
-- 
GitLab