emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7ee12d9: Simplify nnspool-request-newgroups arithme


From: Paul Eggert
Subject: [Emacs-diffs] master 7ee12d9: Simplify nnspool-request-newgroups arithmetic
Date: Tue, 12 Feb 2019 21:25:27 -0500 (EST)

branch: master
commit 7ee12d95fb646fed16c953dc00f8e5bffde959cc
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Simplify nnspool-request-newgroups arithmetic
    
    * lisp/gnus/nnspool.el (nnspool-request-newgroups):
    Simplify by compute time stamps as integers, not floats,
    since integers don’t overflow any more.
---
 lisp/gnus/nnspool.el | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index 0f032f9..767631c 100644
--- a/lisp/gnus/nnspool.el
+++ b/lisp/gnus/nnspool.el
@@ -305,25 +305,18 @@ there.")
        (while (and (not (looking-at
                          "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] "))
                    (zerop (forward-line -1))))
-       ;; We require nnheader which requires gnus-util.
-       (let ((seconds (float-time (date-to-time date)))
+       (let ((seconds (encode-time (date-to-time date) 'integer))
              groups)
          ;; Go through lines and add the latest groups to a list.
          (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ")
                      (progn
-                       ;; We insert a .0 to make the list reader
-                       ;; interpret the number as a float.  It is far
-                       ;; too big to be stored in a lisp integer.
-                       (goto-char (1- (match-end 0)))
-                       (insert ".0")
-                       (> (progn
-                            (goto-char (match-end 1))
-                            (read (current-buffer)))
-                          seconds))
-                     (push (buffer-substring
-                            (match-beginning 1) (match-end 1))
-                           groups)
-                     (zerop (forward-line -1))))
+                       (goto-char (match-end 1))
+                       (< seconds (read (current-buffer))))
+                     (progn
+                       (push (buffer-substring
+                              (match-beginning 1) (match-end 1))
+                             groups)
+                       (zerop (forward-line -1)))))
          (erase-buffer)
          (dolist (group groups)
            (insert group " 0 0 y\n")))



reply via email to

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