projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb38d36
)
Generate fewer useless conditionals in cl-loop
author
Mattias Engdegård
<mattiase@acm.org>
Sat, 4 Jan 2020 12:14:32 +0000
(13:14 +0100)
committer
Mattias Engdegård
<mattiase@acm.org>
Sat, 4 Jan 2020 12:14:32 +0000
(13:14 +0100)
* 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.
lisp/emacs-lisp/cl-macs.el
patch
|
blob
|
history
diff --git
a/lisp/emacs-lisp/cl-macs.el
b/lisp/emacs-lisp/cl-macs.el
index c4f69120ff731f96b4db9407a7dcf685dfc3711c..9d0fd15bc3d1c43b55424b05ed9a28c2dff3e309 100644
(file)
--- a/
lisp/emacs-lisp/cl-macs.el
+++ b/
lisp/emacs-lisp/cl-macs.el
@@
-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--"))