From 3aee7be62eaf8caef6f2fab31bee79674b3abbb7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 22 Oct 2017 01:04:36 -0700 Subject: Avoid unnecessary rounding errors in timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid the rounding errors of float-time when it’s easy. E.g., replace (< (float-time a) (float-time b)) with (time-less-p a b). * lisp/desktop.el (desktop-save): * lisp/ecomplete.el (ecomplete-add-item): * lisp/epg.el (epg-wait-for-completion): * lisp/files.el (dir-locals-find-file, dir-locals-read-from-dir): * lisp/image-dired.el (image-dired-get-thumbnail-image) (image-dired-create-thumb-1): * lisp/info.el (info-insert-file-contents): * lisp/ls-lisp.el (ls-lisp-format-time): * lisp/net/ange-ftp.el (ange-ftp-file-newer-than-file-p) (ange-ftp-verify-visited-file-modtime): * lisp/net/rcirc.el (rcirc-ctcp-sender-PING): * lisp/textmodes/remember.el (remember-store-in-mailbox): * lisp/url/url-cookie.el (url-cookie-expired-p): Bypass float-time to avoid rounding errors. * lisp/files.el (dir-locals-find-file): --- lisp/info.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/info.el') diff --git a/lisp/info.el b/lisp/info.el index 6f87adb04e8..e2f9953f7c7 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -649,7 +649,7 @@ Do the right thing if the file has been compressed or zipped." (attribs-new (and (stringp fullname) (file-attributes fullname))) (modtime-new (and attribs-new (nth 5 attribs-new)))) (when (and modtime-old modtime-new - (> (float-time modtime-new) (float-time modtime-old))) + (time-less-p modtime-old modtime-new)) (setq Info-index-nodes (remove (assoc (or Info-current-file filename) Info-index-nodes) Info-index-nodes)) -- cgit v1.2.1