From: Stefan Monnier Date: Thu, 6 Nov 2014 03:27:23 +0000 (-0500) Subject: * lisp/subr.el (pop): Don't call the getter twice. X-Git-Tag: emacs-25.0.90~2635^2~555 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=577ef0bc58b5e8fd048bcc5bae8c34c4020fa2cc;p=emacs.git * lisp/subr.el (pop): Don't call the getter twice. Fixes: debbugs:18968 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 91a076e20e5..7dc4786aff5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2014-11-06 Stefan Monnier + * subr.el (pop): Don't call the getter twice (bug#18968). + * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial uses of `funcall'. diff --git a/lisp/subr.el b/lisp/subr.el index 55ff739fec5..6ce02b79a0a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -169,7 +169,8 @@ change the list." ;; So we can use `pop' in the bootstrap before `gv' can be used. (list 'prog1 place (list 'setq place (list 'cdr place))) (gv-letplace (getter setter) place - `(prog1 ,getter ,(funcall setter `(cdr ,getter))))))) + (macroexp-let2 macroexp-copyable-p x getter + `(prog1 ,x ,(funcall setter `(cdr ,x)))))))) (defmacro when (cond &rest body) "If COND yields non-nil, do BODY, else return nil.