]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify nnspool-request-newgroups arithmetic
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Feb 2019 02:24:59 +0000 (18:24 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 13 Feb 2019 02:25:22 +0000 (18:25 -0800)
* 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

index 0f032f9a42494a63a26e5729ba19b3068d8d3399..767631c68593b8ea9ce42e55e061ee1a91ad3546 100644 (file)
@@ -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")))