]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure): Minor optimization
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 20:07:42 +0000 (16:07 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Mar 2022 20:07:42 +0000 (16:07 -0400)
lisp/emacs-lisp/bytecomp.el

index c680437f32405043f808145fb3959cb7d1eb2e2c..c39d931517ec7b3c11fea141e59d50da3afd18f9 100644 (file)
@@ -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