use references when creating styles

This commit is contained in:
Axel Kohlmeyer
2020-07-13 09:40:58 -04:00
parent 3847a3000c
commit da66516dec
8 changed files with 41 additions and 41 deletions

View File

@ -653,7 +653,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag)
sflag = 1;
std::string estyle = style + "/" + lmp->suffix;
if (avec_map->find(estyle) != avec_map->end()) {
AtomVecCreator avec_creator = (*avec_map)[estyle];
AtomVecCreator &avec_creator = (*avec_map)[estyle];
return avec_creator(lmp);
}
}
@ -662,7 +662,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag)
sflag = 2;
std::string estyle = style + "/" + lmp->suffix2;
if (avec_map->find(estyle) != avec_map->end()) {
AtomVecCreator avec_creator = (*avec_map)[estyle];
AtomVecCreator &avec_creator = (*avec_map)[estyle];
return avec_creator(lmp);
}
}
@ -670,7 +670,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag)
sflag = 0;
if (avec_map->find(style) != avec_map->end()) {
AtomVecCreator avec_creator = (*avec_map)[style];
AtomVecCreator &avec_creator = (*avec_map)[style];
return avec_creator(lmp);
}