emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/spell-fu 18724c2e53 14/86: Avoid potentially accessing the


From: ELPA Syncer
Subject: [nongnu] elpa/spell-fu 18724c2e53 14/86: Avoid potentially accessing the same files time multiple times
Date: Thu, 7 Jul 2022 12:03:39 -0400 (EDT)

branch: elpa/spell-fu
commit 18724c2e533f6270305f76b290e9dcd578ae82cd
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Avoid potentially accessing the same files time multiple times
---
 spell-fu.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/spell-fu.el b/spell-fu.el
index bd1559857c..1f0e5edebc 100644
--- a/spell-fu.el
+++ b/spell-fu.el
@@ -210,13 +210,12 @@ Argument POS return faces at this point."
 
 (defun spell-fu--file-is-older-list (file-test file-list)
   "Return t when FILE-TEST is older than any files in FILE-LIST."
-  (let ((result nil))
-    (while (and file-list (null result))
-      (let ((file-new (car file-list)))
-        (setq file-list (cdr file-list))
-        (when (time-less-p (nth 5 (file-attributes file-test)) (nth 5 
(file-attributes file-new)))
-          (setq result t))))
-    result))
+  (catch 'result
+    (let ((file-test-time (nth 5 (file-attributes file-test))))
+      (dolist (file-new file-list)
+        (when (time-less-p file-test-time (nth 5 (file-attributes file-new)))
+          (throw 'result t)))
+      nil)))
 
 (defun spell-fu--file-is-older (file-test &rest file-list)
   "Return t when FILE-TEST is older than any files in FILE-LIST."



reply via email to

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