Skip to content
Snippets Groups Projects
Commit 80b8d88c authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better map search

parent 6e0c43d1
No related branches found
No related tags found
No related merge requests found
...@@ -370,8 +370,9 @@ int GModel::setPhysicalName(std::string name, int dim, int number) ...@@ -370,8 +370,9 @@ int GModel::setPhysicalName(std::string name, int dim, int number)
std::string GModel::getPhysicalName(int dim, int number) std::string GModel::getPhysicalName(int dim, int number)
{ {
if(physicalNames.count(std::pair<int, int>(dim, number))) std::map<std::pair<int, int>, std::string>::iterator it =
return physicalNames[std::pair<int, int>(dim, number)]; physicalNames.find(std::pair<int, int>(dim, number));
if(it != physicalNames.end()) return it->second;
return ""; return "";
} }
...@@ -386,8 +387,9 @@ int GModel::getPhysicalNumber(const int &dim, const std::string &name) ...@@ -386,8 +387,9 @@ int GModel::getPhysicalNumber(const int &dim, const std::string &name)
std::string GModel::getElementaryName(int dim, int number) std::string GModel::getElementaryName(int dim, int number)
{ {
if(elementaryNames.count(std::pair<int, int>(dim, number))) std::map<std::pair<int, int>, std::string>::iterator it =
return elementaryNames[std::pair<int, int>(dim, number)]; elementaryNames.find(std::pair<int, int>(dim, number));
if(it != elementaryNames.end()) return it->second;
return ""; return "";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment