forked from lijiext/lammps
accept const std::string as argument in Group::find()
This commit is contained in:
parent
eff159baf4
commit
bf5c1dbc9e
|
@ -584,10 +584,10 @@ void Group::create(char *name, int *flag)
|
|||
return group index if name matches existing group, -1 if no such group
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Group::find(const char *name)
|
||||
int Group::find(const std::string &name)
|
||||
{
|
||||
for (int igroup = 0; igroup < MAX_GROUP; igroup++)
|
||||
if (names[igroup] && strcmp(name,names[igroup]) == 0) return igroup;
|
||||
if (names[igroup] && (name == names[igroup])) return igroup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class Group : protected Pointers {
|
|||
void assign(int, char **); // assign atoms to a group
|
||||
void assign(const std::string &); // convenience function
|
||||
void create(char *, int *); // add flagged atoms to a group
|
||||
int find(const char *); // lookup name in list of groups
|
||||
int find(const std::string &); // lookup name in list of groups
|
||||
int find_or_create(const char *); // lookup name or create new group
|
||||
void write_restart(FILE *);
|
||||
void read_restart(FILE *);
|
||||
|
|
Loading…
Reference in New Issue