Unverified Commit 2781e3e6 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

A few modernizations using clang-tidy

parent 9274675e
Pipeline #4924 passed with stages
in 2 minutes and 25 seconds
......@@ -5995,8 +5995,8 @@ DynamicModel::writeJsonVariableMapping(ostream &output) const
auto [var, eqs] = *it;
output << R"({"name": ")" << symbol_table.getName(var) << R"(", "equations":[)";
bool first_eq = true;
for (auto it2 = eqs.begin(); it2 != eqs.end(); ++it2)
if (auto tmp = equation_tags.getTagValueByEqnAndKey(*it2, "name");
for (int it2 : eqs)
if (auto tmp = equation_tags.getTagValueByEqnAndKey(it2, "name");
!tmp.empty())
{
if (first_eq)
......
/*
* Copyright © 2010-2019 Dynare Team
* Copyright © 2010-2021 Dynare Team
*
* This file is part of Dynare.
*
......@@ -274,7 +274,7 @@ SteadyStateModel::writeJsonSteadyStateFile(ostream &output, bool transformComput
}
if (symb_ids.size() > 1)
output << "]";
output << ", \"rhs\":\"";
output << R"(, "rhs":")";
def_table[i].second->writeJsonOutput(output, {}, {}, false);
output << "\"}" << endl;
}
......
/*
* Copyright © 2019 Dynare Team
* Copyright © 2019-2021 Dynare Team
*
* This file is part of Dynare.
*
......@@ -30,11 +30,11 @@ namespace macro
class Environment
{
private:
const Environment *parent;
const Environment *parent{nullptr};
map<string, ExpressionPtr> variables;
map<string, tuple<FunctionPtr, ExpressionPtr>> functions;
public:
Environment() : parent{nullptr} { }
Environment() = default;
Environment(const Environment *parent_arg) : parent{parent_arg} { }
void define(VariablePtr var, ExpressionPtr value);
void define(FunctionPtr func, ExpressionPtr value);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment