From b0ac4a4e516f41a0e833aa290639c146ff2a76d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 24 Sep 2019 16:02:40 +0200 Subject: [PATCH] Cosmetic change --- src/ComputingTasks.cc | 2 +- src/DynamicModel.cc | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc index 5eac1f84..b9157bf1 100644 --- a/src/ComputingTasks.cc +++ b/src/ComputingTasks.cc @@ -305,7 +305,7 @@ PacModelStatement::overwriteGrowth(expr_t new_growth) growth_info.emplace_back(gv->symb_id, gv->lag, -1, 1); else { - cerr << "Pac growth must be a linear combination of varibles" << endl; + cerr << "Pac growth must be a linear combination of variables" << endl; exit(EXIT_FAILURE); } } diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index fdf8c1a8..f095c3b6 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -4706,16 +4706,8 @@ DynamicModel::fillPacModelInfo(const string &pac_model_name, { pac_eqtag_and_lag.insert(eqtag_and_lag.begin(), eqtag_and_lag.end()); - bool stationary_vars_present = false; - bool nonstationary_vars_present = false; - for (auto it : nonstationary) - if (nonstationary_vars_present && stationary_vars_present) - break; - else - if (it) - nonstationary_vars_present = true; - else - stationary_vars_present = true; + bool stationary_vars_present = any_of(nonstationary.begin(), nonstationary.end(), logical_not<bool>()); + bool nonstationary_vars_present = any_of(nonstationary.begin(), nonstationary.end(), [](bool b) { return b; }); // FIXME: use std::identity instead of an anonymous function when we upgrade to C++20 int growth_param_index = -1; if (growth != nullptr) -- GitLab