summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-09 07:49:51 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-09 07:49:51 -0800
commit646fd3c2ffb2a4ade35bab494457aafe60d5db36 (patch)
tree6e53814cbd6a5a95adf0bace7e79d0f6becd9671
parent066945370c8fa8f3113b07591d44355a385bd468 (diff)
downloadtxr-646fd3c2ffb2a4ade35bab494457aafe60d5db36.tar.gz
txr-646fd3c2ffb2a4ade35bab494457aafe60d5db36.tar.bz2
txr-646fd3c2ffb2a4ade35bab494457aafe60d5db36.zip
compiler: use cons-count.
* stdlib/compiler.tl (simplify-variadic-lambda): Use cons-count to find occurrences of the rest variable rather than flatten and count.
-rw-r--r--stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index 28e9cb96..92c00770 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -2307,7 +2307,7 @@
(if-match @(require (lambda @(and @params @(end @rest))
[sys:apply . @args])
rest
- (eq 1 (count rest (flatten args)))
+ (eq 1 [cons-count rest args eq])
(eq [args -1] rest))
form
^(lambda (,*(butlastn 0 params) ,rest)