; Clarify two comments in byte-optimize-letX

* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Clarify comments.
This commit is contained in:
Stefan Kangas 2024-01-02 04:08:43 +01:00
parent d2528f5c0f
commit f77840a552

View file

@ -1479,7 +1479,7 @@ See Info node `(elisp) Integer Basics'."
(put 'let* 'byte-optimizer #'byte-optimize-letX)
(defun byte-optimize-letX (form)
(pcase form
;; No bindings.
;; Bindings list is empty.
(`(,_ () . ,body)
`(progn . ,body))
@ -1489,7 +1489,7 @@ See Info node `(elisp) Integer Basics'."
`(progn ,@(mapcar #'cadr bindings) ,const)
`(,head ,(butlast bindings) ,(cadar (last bindings)) ,const)))
;; Body is last variable.
;; Body does nothing but return the last variable in bindings.
(`(,head ,(and bindings
(let last-var (caar (last bindings))))
,(and last-var ; non-linear pattern