emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r118301: * lisp/subr.el (pop): Don't call the getter


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r118301: * lisp/subr.el (pop): Don't call the getter twice.
Date: Thu, 06 Nov 2014 03:27:33 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118301
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18968
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2014-11-05 22:27:23 -0500
message:
  * lisp/subr.el (pop): Don't call the getter twice.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-06 03:16:41 +0000
+++ b/lisp/ChangeLog    2014-11-06 03:27:23 +0000
@@ -1,5 +1,7 @@
 2014-11-06  Stefan Monnier  <address@hidden>
 
+       * subr.el (pop): Don't call the getter twice (bug#18968).
+
        * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial
        uses of `funcall'.
 

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2014-10-30 05:15:28 +0000
+++ b/lisp/subr.el      2014-11-06 03:27:23 +0000
@@ -169,7 +169,8 @@
          ;; 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]