From 206667746b86b2ee8f515f1b45777bcbe3c1203d Mon Sep 17 00:00:00 2001 From: renchao_lu <renchao.lu@gmail.com> Date: Mon, 14 Jan 2019 23:03:34 +0100 Subject: [PATCH] [PL] Invoke makeVectorUnique instead. --- ProcessLib/Utils/ProcessUtils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ProcessLib/Utils/ProcessUtils.cpp b/ProcessLib/Utils/ProcessUtils.cpp index 2274622185b..72ed3125d92 100644 --- a/ProcessLib/Utils/ProcessUtils.cpp +++ b/ProcessLib/Utils/ProcessUtils.cpp @@ -73,8 +73,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( if (var_names.empty()) OGS_FATAL("Config tag <%s> is not found.", tag.c_str()); - // collect variable names to check if there are duplicates - std::set<std::string> cached_var_names; + std::vector<std::string> cached_var_names; for (std::string const& var_name : var_names) { @@ -96,9 +95,12 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( vars.emplace_back(const_cast<ProcessVariable&>(*variable)); - cached_var_names.insert(var_name); + cached_var_names.push_back(var_name); } + // Eliminate duplicates in the set of variable names + BaseLib::makeVectorUnique(cached_var_names); + if (cached_var_names.size() != var_names.size()) OGS_FATAL("Found duplicates with config tag <%s>.", tag.c_str()); -- GitLab