[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vundo 1b98c3708c 33/58: * vundo.el (vundo--eqv-merge):
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vundo 1b98c3708c 33/58: * vundo.el (vundo--eqv-merge): Replace nth for performance. |
Date: |
Fri, 15 Apr 2022 12:58:14 -0400 (EDT) |
branch: externals/vundo
commit 1b98c3708c0c204f45b8685e44772f358b20c8e0
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
* vundo.el (vundo--eqv-merge): Replace nth for performance.
---
vundo.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/vundo.el b/vundo.el
index 94b7d03375..eec59cc3c6 100644
--- a/vundo.el
+++ b/vundo.el
@@ -312,12 +312,16 @@ modification in MOD-LIST. Return HASH-TABLE."
(defun vundo--eqv-merge (mlist)
"Connect modifications in MLIST to be in the same equivalence list.
Order is reserved."
- (cl-loop for idx from 0 to (1- (length mlist))
- for this = (nth idx mlist)
- for next = (nth (1+ idx) mlist)
- for prev = nil then (nth (1- idx) mlist)
- do (setf (vundo-m-prev-eqv this) prev)
- do (setf (vundo-m-next-eqv this) next)))
+ ;; Basically, for MLIST = (A B C), set
+ ;; A.prev = nil A.next = B
+ ;; B.prev = A B.next = C
+ ;; C.prev = B C.next = nil
+ (cl-loop for this-tail = mlist then (cdr this-tail)
+ for next-tail = (cdr mlist) then (cdr next-tail)
+ for prev-tail = (cons nil mlist) then (cdr prev-tail)
+ while this-tail
+ do (setf (vundo-m-prev-eqv (car this-tail)) (car prev-tail))
+ do (setf (vundo-m-next-eqv (car this-tail)) (car next-tail))))
(defun vundo--sort-mod (mlist &optional reverse)
"Return sorted modifications in MLIST by their idx...
- [elpa] externals/vundo b93e15e0c2 50/58: * vundo.el: Sync from README., (continued)
- [elpa] externals/vundo b93e15e0c2 50/58: * vundo.el: Sync from README., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 8d7e80d149 40/58: * vundo.el (vundo--refresh-buffer): Update docstring., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 4341d838aa 44/58: * vundo.el (vundo-glyph-alist): Escape backtick in docstring., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 6acda40607 42/58: Fix vundo-forward, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 377194b705 58/58: * vundo.el: Fix dependency tag., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 9657909b43 51/58: Trim a nreverse call in vundo--eqv-list-of, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo ab84e87522 01/58: init, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 549efe15c3 14/58: UI change: default to ASCII and more, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo b27ddfecfd 25/58: Handle user quit gracefully, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 8a2f09ae42 29/58: Merge branch 'pr-avoid-list-nth', ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 1b98c3708c 33/58: * vundo.el (vundo--eqv-merge): Replace nth for performance.,
ELPA Syncer <=
- [elpa] externals/vundo d833570d47 49/58: Update README per request, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 7ddb684eb5 53/58: * vundo.el (vundo--draw-tree): Set inhibit-modification-hooks to t., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 9edd0ca36b 46/58: * vundo.el (vundo--eqv-list-of): Replace reverse with nreverse., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo f8cd72b611 30/58: * test/vundo-test.el (vundo-test--skip-position-only): New test., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 76a54ce79d 36/58: * README.txt (Tests): New section., ELPA Syncer, 2022/04/15
- [elpa] externals/vundo 7cafb7aac5 37/58: Merge branch 'pr-readme-test', ELPA Syncer, 2022/04/15
- [elpa] externals/vundo c9e8909c50 52/58: Merge branch 'pr-no-nreverse', ELPA Syncer, 2022/04/15
- [elpa] externals/vundo acdc70671a 48/58: Improve README for publishing, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo b40f5fcd52 09/58: Fix: closing vundo with RET makes the buffer read-only, ELPA Syncer, 2022/04/15
- [elpa] externals/vundo e89a292c15 19/58: Rename vundo--mode to vundo-mode, ELPA Syncer, 2022/04/15