changeset 39777:cb878b38afc6

(byte-optimize-lapcode) <byte-constref-ops>: Consider byte-constant2 and clarify the code. <const-C varset-X const-C>: Fix car/cdr typo.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 11 Oct 2001 17:25:26 +0000
parents a3873ce994df
children 939f548d08cd
files lisp/emacs-lisp/byte-opt.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/byte-opt.el	Thu Oct 11 15:39:47 2001 +0000
+++ b/lisp/emacs-lisp/byte-opt.el	Thu Oct 11 17:25:26 2001 +0000
@@ -1879,20 +1879,21 @@
       (setq lap0 (car rest)
 	    lap1 (nth 1 rest))
       (if (memq (car lap0) byte-constref-ops)
-	  (if (not (eq (car lap0) 'byte-constant))
-	      (or (memq (cdr lap0) byte-compile-variables)
-		  (setq byte-compile-variables (cons (cdr lap0)
-						     byte-compile-variables)))
-	    (or (memq (cdr lap0) byte-compile-constants)
+	  (if (or (eq (car lap0) 'byte-constant)
+		  (eq (car lap0) 'byte-constant2))
+	      (unless (memq (cdr lap0) byte-compile-constants)
 		(setq byte-compile-constants (cons (cdr lap0)
-						   byte-compile-constants)))))
+						   byte-compile-constants)))
+	    (unless (memq (cdr lap0) byte-compile-variables)
+	      (setq byte-compile-variables (cons (cdr lap0)
+						 byte-compile-variables)))))
       (cond (;;
 	     ;; const-C varset-X const-C  -->  const-C dup varset-X
 	     ;; const-C varbind-X const-C  -->  const-C dup varbind-X
 	     ;;
 	     (and (eq (car lap0) 'byte-constant)
 		  (eq (car (nth 2 rest)) 'byte-constant)
-		  (eq (cdr lap0) (car (nth 2 rest)))
+		  (eq (cdr lap0) (cdr (nth 2 rest)))
 		  (memq (car lap1) '(byte-varbind byte-varset)))
 	     (byte-compile-log-lap "  %s %s %s\t-->\t%s dup %s"
 				   lap0 lap1 lap0 lap0 lap1)