[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vundo c66abe86e1 2/2: Avoid duplicating vundo--timestam
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vundo c66abe86e1 2/2: Avoid duplicating vundo--timestamps |
Date: |
Fri, 16 Feb 2024 00:59:00 -0500 (EST) |
branch: externals/vundo
commit c66abe86e12671ce46552a38d63a2b635bff23b9
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: Yuan Fu <casouri@gmail.com>
Avoid duplicating vundo--timestamps
* vundo.el (vundo--record-timestamps): The sorted value of the
produced timestamp alist is significant, so it should not contain
duplicates.
---
vundo.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vundo.el b/vundo.el
index 281ef474c8..a8aae1d5b8 100644
--- a/vundo.el
+++ b/vundo.el
@@ -556,13 +556,13 @@ The alist is sorted by time, with latest saved mods
first."
if ts do
(let* ((mod-node (aref mod-list (1- idx)))
(master (vundo--master-eqv-mod-of mod-node))
- (old-ts (cdr (assq master timestamps))))
+ (entry (assq master timestamps))
+ (old-ts (cdr entry)))
(when (and old-ts (time-less-p ts old-ts))
;; Equivalent node modified again? take the newer time.
(setq ts old-ts))
- ;; Push the new pair to TIMESTAMPS, so it overrides
- ;; previously pushed pairs.
- (push (cons master ts) timestamps)))
+ (if entry (setcdr entry ts)
+ (push (cons master ts) timestamps))))
(sort timestamps ; Sort latest first.
(lambda (a b) (time-less-p (cdr b) (cdr a))))))