diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-03-18 16:07:42 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-03-18 16:07:42 -0400 |
commit | ab8a34ce8a54539cc9f66892145153312fa2a7fa (patch) | |
tree | c8335d2266e5b2f98adc01ab9e36ad91e94c2cc5 /lisp/emacs-lisp/bytecomp.el | |
parent | ce28de5d3a1293ceaf4317520ec8c3d2095ab947 (diff) | |
download | emacs-ab8a34ce8a54539cc9f66892145153312fa2a7fa.tar.gz emacs-ab8a34ce8a54539cc9f66892145153312fa2a7fa.tar.bz2 emacs-ab8a34ce8a54539cc9f66892145153312fa2a7fa.zip |
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Minor optimization
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index c680437f324..c39d931517e 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3924,7 +3924,7 @@ discarding." docstring-exp)) ;Otherwise, we don't need a closure. (cl-assert (byte-code-function-p fun)) (byte-compile-form - (if (or (not docstring-exp) (stringp docstring-exp)) + (if (macroexp-const-p docstring-exp) ;; Use symbols V0, V1 ... as placeholders for closure variables: ;; they should be short (to save space in the .elc file), yet ;; distinct when disassembled. @@ -3940,7 +3940,7 @@ discarding." (vconcat dummy-vars (aref fun 2)) (aref fun 3) (if docstring-exp - (cons docstring-exp (cdr opt-args)) + (cons (eval docstring-exp t) (cdr opt-args)) opt-args)))) `(make-closure ,proto-fun ,@env)) ;; Nontrivial doc string expression: create a bytecode object |