diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2021-03-20 17:02:22 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2021-03-20 20:01:22 -0400 |
commit | 8657daadd3658f98bc72729ae1afc8ecf54b391d (patch) | |
tree | 2b69503f0e4471cdae28128ee423bb5d9873307b /src/interp.c | |
parent | 5ab0f201ee0b5631939c30e323c2241007902dc8 (diff) |
stop performing atoi() repeatedly on config values
Now that we store both the string and the numeric value for every config
entries, let's grab those values directly. This should save quite some
processing cycles.
Those changes were performed with the following command:
sed -e 's/atoi(get_conf_value *(\([^)]*\)))/get_conf_int(\1)/g' -i *.c *.y
Diffstat (limited to 'src/interp.c')
-rw-r--r-- | src/interp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interp.c b/src/interp.c index 526ff75..4c9f6a5 100644 --- a/src/interp.c +++ b/src/interp.c @@ -1507,7 +1507,7 @@ char * doext(struct enode *se) { command = seval(NULL, se->e.o.left); value = eval(NULL, se->e.o.right); - if ( ! atoi(get_conf_value("external_functions")) ) { + if ( ! get_conf_int("external_functions") ) { sc_error("Warning: external functions disabled; using %s value", (se->e.o.s && *se->e.o.s) ? "previous" : "null"); @@ -2182,7 +2182,7 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow_, int lastcol_, regex_t preg; int errcode; - if ( atoi(get_conf_value("ignorecase"))) + if ( get_conf_int("ignorecase")) errcode = regcomp(&preg, s, REG_EXTENDED | REG_ICASE); else errcode = regcomp(&preg, s, REG_EXTENDED); |