diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-29 06:45:17 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-29 06:45:17 -0700 |
commit | 706e9bc7983ebb54cfbd7f95b1e98252dfd0d558 (patch) | |
tree | 86422b089d1b08600328641aa7e97e0fa0366ad8 /ftw.h | |
parent | 37b9e093822a7cb4d813b5ea41d6097cce54de33 (diff) | |
download | txr-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 'ftw.h')
0 files changed, 0 insertions, 0 deletions