diff options
| author | Paul Eggert | 2019-02-12 18:24:59 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-02-12 18:25:22 -0800 |
| commit | 7ee12d95fb646fed16c953dc00f8e5bffde959cc (patch) | |
| tree | f4f936a4836433caaefa0868faf0e955c72c8e7e | |
| parent | 21eef9fa7f5abc7587251a6671add780b7370bb7 (diff) | |
| download | emacs-7ee12d95fb646fed16c953dc00f8e5bffde959cc.tar.gz emacs-7ee12d95fb646fed16c953dc00f8e5bffde959cc.zip | |
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.
| -rw-r--r-- | lisp/gnus/nnspool.el | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index 0f032f9a424..767631c6859 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el | |||
| @@ -305,25 +305,18 @@ there.") | |||
| 305 | (while (and (not (looking-at | 305 | (while (and (not (looking-at |
| 306 | "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] ")) | 306 | "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] ")) |
| 307 | (zerop (forward-line -1)))) | 307 | (zerop (forward-line -1)))) |
| 308 | ;; We require nnheader which requires gnus-util. | 308 | (let ((seconds (encode-time (date-to-time date) 'integer)) |
| 309 | (let ((seconds (float-time (date-to-time date))) | ||
| 310 | groups) | 309 | groups) |
| 311 | ;; Go through lines and add the latest groups to a list. | 310 | ;; Go through lines and add the latest groups to a list. |
| 312 | (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ") | 311 | (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ") |
| 313 | (progn | 312 | (progn |
| 314 | ;; We insert a .0 to make the list reader | 313 | (goto-char (match-end 1)) |
| 315 | ;; interpret the number as a float. It is far | 314 | (< seconds (read (current-buffer)))) |
| 316 | ;; too big to be stored in a lisp integer. | 315 | (progn |
| 317 | (goto-char (1- (match-end 0))) | 316 | (push (buffer-substring |
| 318 | (insert ".0") | 317 | (match-beginning 1) (match-end 1)) |
| 319 | (> (progn | 318 | groups) |
| 320 | (goto-char (match-end 1)) | 319 | (zerop (forward-line -1))))) |
| 321 | (read (current-buffer))) | ||
| 322 | seconds)) | ||
| 323 | (push (buffer-substring | ||
| 324 | (match-beginning 1) (match-end 1)) | ||
| 325 | groups) | ||
| 326 | (zerop (forward-line -1)))) | ||
| 327 | (erase-buffer) | 320 | (erase-buffer) |
| 328 | (dolist (group groups) | 321 | (dolist (group groups) |
| 329 | (insert group " 0 0 y\n"))) | 322 | (insert group " 0 0 y\n"))) |