From 0f77313cafafd195c4f4572c578d58612c3c3f36 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 9 Feb 2024 07:49:51 -0800 Subject: 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. --- stdlib/compiler.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3