emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 112fbe3 1/2: Minor simplification for byte-compile-


From: Noam Postavsky
Subject: [Emacs-diffs] master 112fbe3 1/2: Minor simplification for byte-compile-constant-push
Date: Tue, 29 Aug 2017 23:17:26 -0400 (EDT)

branch: master
commit 112fbe35153b2cb66b4daca32a84b18192c814db
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Minor simplification for byte-compile-constant-push
    
    * lisp/emacs-lisp/bytecomp.el (byte-compile-constant): Move the meat
    of the code from here...
    (byte-compile-constant-push): ... to here.  No need to bind
    byte-compile--for-effect anymore.
---
 lisp/emacs-lisp/bytecomp.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 48bbd61..dc8839e 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3342,15 +3342,14 @@ for symbols generated by the byte compiler itself."
 (defun byte-compile-constant (const)
   (if byte-compile--for-effect
       (setq byte-compile--for-effect nil)
-    (when (symbolp const)
-      (byte-compile-set-symbol-position const))
-    (byte-compile-out 'byte-constant (byte-compile-get-constant const))))
+    (inline (byte-compile-push-constant const))))
 
 ;; Use this for a constant that is not the value of its containing form.
 ;; This ignores byte-compile--for-effect.
 (defun byte-compile-push-constant (const)
-  (let ((byte-compile--for-effect nil))
-    (inline (byte-compile-constant const))))
+  (when (symbolp const)
+    (byte-compile-set-symbol-position const))
+  (byte-compile-out 'byte-constant (byte-compile-get-constant const)))
 
 ;; Compile those primitive ordinary functions
 ;; which have special byte codes just for speed.



reply via email to

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