Generate fewer useless conditionals in cl-loop

* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause):
Don't generate a condition if both branches are the same, which
is the common case.
This commit is contained in:
Mattias Engdegård 2020-01-04 13:14:32 +01:00
parent fb38d367f4
commit 8e3868125c

View file

@ -1318,7 +1318,10 @@ For more details, see Info node `(cl)Loop Facility'.
(nreverse cl--loop-conditions)))
,then ,var))
loop-for-steps))
(push `(,var (if ,first-assign ,start ,then)) loop-for-sets))))
(push (if (eq start then)
`(,var ,then)
`(,var (if ,first-assign ,start ,then)))
loop-for-sets))))
((memq word '(across across-ref))
(let ((temp-vec (make-symbol "--cl-vec--"))