Unverified Commit d73d1384 authored by Vibhav Pant's avatar Vibhav Pant
Browse files

Fix byte-optimize-memq incorrectly optimizing some memq forms.

* 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.
parent a140513a
......@@ -774,10 +774,11 @@
(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)))
(byte-optimize-and form)))
(setq form (byte-optimize-and
`(and ,(byte-optimize-predicate
`(eq ,(nth 1 form) ',(nth 0 list)))
(byte-optimize-predicate form)))
(put 'identity 'byte-optimizer 'byte-optimize-identity)
(put 'memq 'byte-optimizer 'byte-optimize-memq)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment