branch: elpa/git-commit
commit 7e144529b7fca345fcaa92d7e986688ea24ae94c
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Use time-since instead of time-subtract
---
 lisp/magit-autorevert.el | 2 +-
 lisp/magit-diff.el       | 2 +-
 lisp/magit-mode.el       | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/magit-autorevert.el b/lisp/magit-autorevert.el
index e50dbe6496..ebac571ea8 100644
--- a/lisp/magit-autorevert.el
+++ b/lisp/magit-autorevert.el
@@ -152,7 +152,7 @@ and code surrounding the definition of this function."
       (magit-auto-revert-mode 1)
       (magit-message
        "Turning on magit-auto-revert-mode...done%s"
-       (let ((elapsed (float-time (time-subtract nil start))))
+       (let ((elapsed (float-time (time-since start))))
          (if (> elapsed 0.2)
              (format " (%.3fs, %s buffers checked)" elapsed
                      (length (buffer-list)))
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index e36a38b271..90cc8ddadb 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2525,7 +2525,7 @@ section or a child thereof."
 (defun magit-diff-expansion-threshold (section)
   "Keep new diff sections collapsed if washing takes too long."
   (and (magit-file-section-p section)
-       (> (float-time (time-subtract (current-time) magit-refresh-start-time))
+       (> (float-time (time-since magit-refresh-start-time))
           magit-diff-expansion-threshold)
        'hide))
 
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 4f7f21fed5..4c4465ed2d 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1009,7 +1009,7 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
             (let* ((c (caar magit--refresh-cache))
                    (a (+ c (cdar magit--refresh-cache))))
               (message "Refreshing magit...done (%.3fs, cached %s/%s (%.0f%%))"
-                       (float-time (time-subtract (current-time) start))
+                       (float-time (time-since start))
                        c a (* (/ c (* a 1.0)) 100)))))
       (run-hooks 'magit-unwind-refresh-hook))))
 
@@ -1076,8 +1076,7 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
         (set-buffer-modified-p nil))
       (when magit-refresh-verbose
         (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
-                 (float-time (time-subtract (current-time)
-                                            magit-refresh-start-time)))))))
+                 (float-time (time-since magit-refresh-start-time)))))))
 
 (defun magit-profile-refresh-buffer ()
   "Profile refreshing the current Magit buffer."

Reply via email to