emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fb66e4d58bb 2/2: nndiary.el: fix dodgy schedule code


From: Mattias Engdegård
Subject: master fb66e4d58bb 2/2: nndiary.el: fix dodgy schedule code
Date: Tue, 11 Apr 2023 06:18:55 -0400 (EDT)

branch: master
commit fb66e4d58bbc24abf44157078e8ca51ffed93113
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    nndiary.el: fix dodgy schedule code
    
    * lisp/gnus/nndiary.el (nndiary-last-occurrence):
    Don't sort a list and throw away the result because that leaves the
    list variable in an undefined state.  Just take the largest element
    because that was obviously what the author meant.
---
 lisp/gnus/nndiary.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index be2bdc9bb15..8728aab1def 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1373,10 +1373,10 @@ all.  This may very well take some time.")
                       (setq day (+ 7 day))))
                   ;; Finally, if we have some days, they are valid
                   (when days
-                    (sort days #'>)
                     (throw 'found
                            (encode-time 0 minute hour
-                                        (car days) month year time-zone)))
+                                        (apply #'max days)
+                                         month year time-zone)))
                   )))))
         ;; There's an upper limit, but we didn't find any last occurrence.
         ;; This means that the schedule is undecidable. This can happen if



reply via email to

[Prev in Thread] Current Thread [Next in Thread]