reverse => nreverse; other optimizations
This commit is contained in:
parent
4723a3d76f
commit
27cc4a9508
7 changed files with 22 additions and 22 deletions
|
@ -6,12 +6,12 @@
|
|||
(def-setting! :evil-state (&rest mode-state-list)
|
||||
"Set the initialize STATE of MODE using `evil-set-initial-state'."
|
||||
(if (cl-every 'listp mode-state-list)
|
||||
(let (forms)
|
||||
(dolist (it mode-state-list)
|
||||
(unless (consp it)
|
||||
(error ":evil-state expected cons cells, got %s" it))
|
||||
(push `(evil-set-initial-state ',(car it) ',(cdr it)) forms))
|
||||
`(progn ,@(reverse forms)))
|
||||
`(progn
|
||||
,@(let (forms)
|
||||
(dolist (it mode-state-list (nreverse forms))
|
||||
(unless (consp it)
|
||||
(error ":evil-state expected cons cells, got %s" it))
|
||||
(push `(evil-set-initial-state ',(car it) ',(cdr it)) forms))))
|
||||
(let ((argc (length mode-state-list)))
|
||||
(unless (= argc 2)
|
||||
(error ":evil-state expected 2 arguments, got %s" argc)))
|
||||
|
|
|
@ -299,7 +299,7 @@ end of the workspace list."
|
|||
(defun +workspace/switch-to-last ()
|
||||
"Switch to the last workspace."
|
||||
(interactive)
|
||||
(+workspace/switch-to (car (reverse (+workspace-list)))))
|
||||
(+workspace/switch-to (car (last (+workspace-list)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +workspace/cycle (n)
|
||||
|
|
|
@ -216,7 +216,7 @@ project root). Excludes the file basename. See `doom-buffer-name' for that."
|
|||
(max-length (truncate (* (window-body-width) 0.4))))
|
||||
(when (and buffer-path (not (equal buffer-path ".")))
|
||||
(if (> (length buffer-path) max-length)
|
||||
(let ((path (reverse (split-string buffer-path "/" t)))
|
||||
(let ((path (nreverse (split-string buffer-path "/" t)))
|
||||
(output ""))
|
||||
(when (and path (equal "" (car path)))
|
||||
(setq path (cdr path)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue