mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-30 08:09:04 +00:00
* lisp/emacs-lisp/byte-opt.el (byte-optimize-binary-predicate): Don't assume
there can't be more than 2 arguments. Fixes: debbugs:17584
This commit is contained in:
parent
6c5fa28d4f
commit
53bc1e2982
@ -1,3 +1,8 @@
|
||||
2014-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emacs-lisp/byte-opt.el (byte-optimize-binary-predicate): Don't assume
|
||||
there can't be more than 2 arguments (bug#17584).
|
||||
|
||||
2014-05-27 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* simple.el (filter-buffer-substring-functions)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user