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
commit0f77313cafafd195c4f4572c578d58612c3c3f36 (patch)
tree6e53814cbd6a5a95adf0bace7e79d0f6becd9671
parentab58598e62eb7ca718d2ee083c1c2c2ede4d6db3 (diff)
downloadtxr-0f77313cafafd195c4f4572c578d58612c3c3f36.tar.gz
txr-0f77313cafafd195c4f4572c578d58612c3c3f36.tar.bz2
txr-0f77313cafafd195c4f4572c578d58612c3c3f36.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)