summaryrefslogtreecommitdiffstats
path: root/src/gram.y
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2021-03-20 17:02:22 -0400
committerNicolas Pitre <nico@fluxnic.net>2021-03-20 20:01:22 -0400
commit8657daadd3658f98bc72729ae1afc8ecf54b391d (patch)
tree2b69503f0e4471cdae28128ee423bb5d9873307b /src/gram.y
parent5ab0f201ee0b5631939c30e323c2241007902dc8 (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/gram.y')
-rwxr-xr-xsrc/gram.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gram.y b/src/gram.y
index 08e87bc..4299388 100755
--- a/src/gram.y
+++ b/src/gram.y
@@ -635,7 +635,7 @@ command:
| S_CELLCOLOR var_or_range STRING
{
#ifdef USECOLORS
- if ( ! atoi(get_conf_value("nocurses")))
+ if ( ! get_conf_int("nocurses"))
color_cell($2.left.vp->row, $2.left.vp->col, $2.right.vp->row, $2.right.vp->col, $3);
#endif
scxfree($3);
@@ -652,7 +652,7 @@ command:
| S_CELLCOLOR STRING {
#ifdef USECOLORS
- if ( ! atoi(get_conf_value("nocurses")))
+ if ( ! get_conf_int("nocurses"))
color_cell(currow, curcol, currow, curcol, $2);
#endif
scxfree($2);
@@ -660,13 +660,13 @@ command:
| S_UNFORMAT var_or_range {
#ifdef USECOLORS
- if ( ! atoi(get_conf_value("nocurses"))) unformat($2.left.vp->row, $2.left.vp->col, $2.right.vp->row, $2.right.vp->col);
+ if ( ! get_conf_int("nocurses")) unformat($2.left.vp->row, $2.left.vp->col, $2.right.vp->row, $2.right.vp->col);
#endif
}
| S_UNFORMAT {
#ifdef USECOLORS
- if ( ! atoi(get_conf_value("nocurses"))) unformat(currow, curcol, currow, curcol);
+ if ( ! get_conf_int("nocurses")) unformat(currow, curcol, currow, curcol);
#endif
}