Skip to content
Snippets Groups Projects
Commit 20666774 authored by renchao.lu's avatar renchao.lu
Browse files

[PL] Invoke makeVectorUnique instead.

parent 8a2b923a
No related branches found
No related tags found
No related merge requests found
...@@ -73,8 +73,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( ...@@ -73,8 +73,7 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables(
if (var_names.empty()) if (var_names.empty())
OGS_FATAL("Config tag <%s> is not found.", tag.c_str()); OGS_FATAL("Config tag <%s> is not found.", tag.c_str());
// collect variable names to check if there are duplicates std::vector<std::string> cached_var_names;
std::set<std::string> cached_var_names;
for (std::string const& var_name : var_names) for (std::string const& var_name : var_names)
{ {
...@@ -96,9 +95,12 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables( ...@@ -96,9 +95,12 @@ std::vector<std::reference_wrapper<ProcessVariable>> findProcessVariables(
vars.emplace_back(const_cast<ProcessVariable&>(*variable)); 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()) if (cached_var_names.size() != var_names.size())
OGS_FATAL("Found duplicates with config tag <%s>.", tag.c_str()); OGS_FATAL("Found duplicates with config tag <%s>.", tag.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment