Made cp_enqvar() mode modular by adding a separate function to handle the case of a vector. Lists are more efficiently handled by moving common comparisons out of the loop over elements. The first argument of cp_enqvar() is changed from char * to const char * since the name of the variable being found is not altered by the function.

This commit is contained in:
Jim Monte
2020-03-15 08:50:53 +01:00
committed by Holger Vogt
parent 72801b1ab1
commit ad970ae4e7
2 changed files with 133 additions and 64 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ extern void cp_periodic(void);
extern void ft_cpinit(void);
extern struct comm *cp_coms;
extern char *cp_program;
extern struct variable *cp_enqvar(char *word, int *tbfreed);
extern struct variable *cp_enqvar(const char *word, int *tbfreed);
extern struct variable *cp_usrvars(void);
int cp_usrset(struct variable *var, bool isset);
extern void fatal(void);