]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Improve perf for meshes with huge number of grps/families.
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 20 Jun 2016 13:41:04 +0000 (15:41 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 20 Jun 2016 13:41:04 +0000 (15:41 +0200)
src/MEDLoader/MEDFileMesh.cxx

index bd2fb0e24cac67844280843aae0829cb844242b2..90c34e17eccc7e86f5be948a0397213895f995e0 100644 (file)
@@ -1432,11 +1432,10 @@ void MEDFileMesh::setGroupInfo(const std::map<std::string, std::vector<std::stri
  */
 int MEDFileMesh::getFamilyId(const std::string& name) const
 {
-  std::string oname(name);
-  std::map<std::string, int>::const_iterator it=_families.find(oname);
-  std::vector<std::string> fams=getFamiliesNames();
+  std::map<std::string, int>::const_iterator it=_families.find(name);
   if(it==_families.end())
     {
+      std::vector<std::string> fams(getFamiliesNames());
       std::ostringstream oss; oss << "No such familyname \"" << name << "\" !\nAvailable families are :";
       std::copy(fams.begin(),fams.end(),std::ostream_iterator<std::string>(oss," "));
       throw INTERP_KERNEL::Exception(oss.str().c_str());