From be023bdab97d570e981f14727022344098b89950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Thu, 21 Feb 2019 12:15:50 +0100 Subject: [PATCH] Simplification: the [] operator already inserts the new element See https://en.cppreference.com/w/cpp/container/map/operator_at --- src/DynamicModel.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index 8831344d..82d02788 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -3631,11 +3631,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de // Write Pac equation tag info map<string, vector<pair<string, string>>> for_writing; for (auto & it : pac_eqtag_and_lag) - { - if (for_writing.find(it.first.first) == for_writing.end()) - for_writing.emplace(it.first.first, vector<pair<string, string>>()); - for_writing[it.first.first].emplace_back(it.first.second, it.second.first); - } + for_writing[it.first.first].emplace_back(it.first.second, it.second.first); for (auto & it : for_writing) { -- GitLab