summaryrefslogtreecommitdiffstats
path: root/args.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-29 06:45:17 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-29 06:45:17 -0700
commit706e9bc7983ebb54cfbd7f95b1e98252dfd0d558 (patch)
tree86422b089d1b08600328641aa7e97e0fa0366ad8 /args.h
parent37b9e093822a7cb4d813b5ea41d6097cce54de33 (diff)
downloadtxr-706e9bc7983ebb54cfbd7f95b1e98252dfd0d558.tar.gz
txr-706e9bc7983ebb54cfbd7f95b1e98252dfd0d558.tar.bz2
txr-706e9bc7983ebb54cfbd7f95b1e98252dfd0d558.zip
lib: eliminate reduce-left from n-ary math ops.
Using reduce-left is inefficient; it conses up a list. We can decimate the stacked arguments without consing. * lib.c (nary_op): Replace reduce_left with iteration. (nary_simple_op): New function, variant of nary_op useable by functions that have a mandatory argument passed separately from the argument list. (minusv, divv): Replace reduce_left with iteration. (maxv, minv): Replace reduce_left with nary_simple_op. (abso_self): New static function. (gcdv, lcmv): Replace reduce_left with nary_op. * lib.h (nary_simple_op): Declared.
Diffstat (limited to 'args.h')
0 files changed, 0 insertions, 0 deletions