Don't expand body inside a let-binding when there are no bindings
* lisp/emacs-lisp/pcase.el (pcase-codegen): Only let-bind if VARS is non-nil.
This commit is contained in:
parent
8ed8ef307d
commit
1b4442bee9
1 changed files with 4 additions and 2 deletions
|
@ -437,8 +437,10 @@ to this macro."
|
|||
;; Don't use let*, otherwise macroexp-let* may merge it with some surrounding
|
||||
;; let* which might prevent the setcar/setcdr in pcase--expand's fancy
|
||||
;; codegen from later metamorphosing this let into a funcall.
|
||||
`(let ,(mapcar (lambda (b) (list (car b) (cdr b))) vars)
|
||||
,@code))
|
||||
(if vars
|
||||
`(let ,(mapcar (lambda (b) (list (car b) (cdr b))) vars)
|
||||
,@code)
|
||||
`(progn ,@code)))
|
||||
|
||||
(defun pcase--small-branch-p (code)
|
||||
(and (= 1 (length code))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue