X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/eed652d649d28e9dafdb01f9c7425d7d28899e0d..953e106ac84587e765244995687b088969b5f6e1:/lisp/emacs-lisp/byte-opt.el diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 90d1dd913e..ee0a5a11c7 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -859,14 +859,16 @@ (defun byte-optimize-binary-predicate (form) - (if (macroexp-const-p (nth 1 form)) - (if (macroexp-const-p (nth 2 form)) - (condition-case () - (list 'quote (eval form)) - (error form)) - ;; This can enable some lapcode optimizations. - (list (car form) (nth 2 form) (nth 1 form))) - form)) + (cond + ((or (not (macroexp-const-p (nth 1 form))) + (nthcdr 3 form)) ;; In case there are more than 2 args. + form) + ((macroexp-const-p (nth 2 form)) + (condition-case () + (list 'quote (eval form)) + (error form))) + (t ;; This can enable some lapcode optimizations. + (list (car form) (nth 2 form) (nth 1 form))))) (defun byte-optimize-predicate (form) (let ((ok t)