From 9cafad653dbb6b09c6ee283fb105d000e0c8c0c2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 16 Mar 2021 06:59:23 -0700 Subject: compiler: trim unused accumulation from var-spy. The var-spy structure is only being used for detecting captured variables, not assigned or accessed variables. So the information about accessed and assigned is being wastefully accumulated, never used. * share/txr/stdlib/compiler.tl (struct var-spy): Remove slots acc-vars and set-vars. (var-spy accessed, var-spy assigned): Methods become no-ops. --- share/txr/stdlib/compiler.tl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index c3e11d94..622ac476 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -140,17 +140,11 @@ (defstruct var-spy () env - acc-vars - set-vars cap-vars - (:method accessed (me vbin sym) - (when (eq vbin.env me.env) - (pushnew sym me.acc-vars))) + (:method accessed (me vbin sym)) - (:method assigned (me vbin sym) - (when (eq vbin.env me.env) - (pushnew sym me.set-vars))) + (:method assigned (me vbin sym)) (:method captured (me vbin sym) (when (eq vbin.env me.env) -- cgit v1.2.3