simplify variable lookup in set command

This commit is contained in:
Axel Kohlmeyer
2020-09-19 16:04:09 -04:00
parent 89506efd23
commit c91ee210e4
2 changed files with 3 additions and 10 deletions

View File

@ -1351,17 +1351,10 @@ void Set::topology(int keyword)
/* ---------------------------------------------------------------------- */
void Set::varparse(char *name, int m)
void Set::varparse(const char *name, int m)
{
varflag = 1;
name = &name[2];
int n = strlen(name) + 1;
char *str = new char[n];
strcpy(str,name);
int ivar = input->variable->find(str);
delete [] str;
int ivar = input->variable->find(name+2);
if (ivar < 0)
error->all(FLERR,"Variable name for set command does not exist");

View File

@ -48,7 +48,7 @@ class Set : protected Pointers {
void set(int);
void setrandom(int);
void topology(int);
void varparse(char *, int);
void varparse(const char *, int);
};
}