simplify variable lookup in set command
This commit is contained in:
11
src/set.cpp
11
src/set.cpp
@ -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;
|
varflag = 1;
|
||||||
|
int ivar = input->variable->find(name+2);
|
||||||
name = &name[2];
|
|
||||||
int n = strlen(name) + 1;
|
|
||||||
char *str = new char[n];
|
|
||||||
strcpy(str,name);
|
|
||||||
|
|
||||||
int ivar = input->variable->find(str);
|
|
||||||
delete [] str;
|
|
||||||
|
|
||||||
if (ivar < 0)
|
if (ivar < 0)
|
||||||
error->all(FLERR,"Variable name for set command does not exist");
|
error->all(FLERR,"Variable name for set command does not exist");
|
||||||
|
|||||||
Reference in New Issue
Block a user