summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-08-13 10:06:45 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-08-29 22:58:50 -0400
commit112fbe35153b2cb66b4daca32a84b18192c814db (patch)
tree0be3c2a6b9b8215ee9c6059ea51b651741d424da /lisp/emacs-lisp/bytecomp.el
parent70bb510a7eb1a3010cfa034884b7e5ab2063ece3 (diff)
downloademacs-112fbe35153b2cb66b4daca32a84b18192c814db.tar.gz
emacs-112fbe35153b2cb66b4daca32a84b18192c814db.tar.bz2
emacs-112fbe35153b2cb66b4daca32a84b18192c814db.zip
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.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 48bbd618712..dc8839e6f99 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.