]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix byte-optimize-memq incorrectly optimizing some memq forms.
authorVibhav Pant <vibhavp@gmail.com>
Sun, 25 Mar 2018 05:52:50 +0000 (11:22 +0530)
committerAndrew G Cohen <cohen@andy.bu.edu>
Tue, 11 Dec 2018 06:18:30 +0000 (14:18 +0800)
* lisp/emacs-lisp/byte-opt.el (byte-optimize-memq): Call
  byte-optimize-and only for memq forms that can be optimized, use
  byte-optimize-predicate to optimize the final form.

lisp/emacs-lisp/byte-opt.el

index 54421e01be65e55f169f0e24285416689dff7900..004f58cc12fd5ce5c7eba060e5cd34fae07db190 100644 (file)
       (when (and (eq (car-safe list) 'quote)
                  (listp (setq list (cadr list)))
                  (= (length list) 1))
-        (setq form `(and ,(byte-optimize-predicate
-                           `(eq ,(nth 1 form) ',(nth 0 list)))
-                         ',list))))
-    (byte-optimize-and form)))
+        (setq form (byte-optimize-and
+                    `(and ,(byte-optimize-predicate
+                            `(eq ,(nth 1 form) ',(nth 0 list)))
+                          ',list)))))
+    (byte-optimize-predicate form)))
 
 (put 'identity 'byte-optimizer 'byte-optimize-identity)
 (put 'memq 'byte-optimizer 'byte-optimize-memq)