# HG changeset patch # User Gerd Moellmann # Date 1002821126 0 # Node ID cb878b38afc6ec2fe7ecf6e7da81f6afa5b66add # Parent a3873ce994dfc6be72cf5038a7850deaae45d554 (byte-optimize-lapcode) : Consider byte-constant2 and clarify the code. : Fix car/cdr typo. diff -r a3873ce994df -r cb878b38afc6 lisp/emacs-lisp/byte-opt.el --- 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)