emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/iso8601 b00264d 1/3: Clean up slightly


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] scratch/iso8601 b00264d 1/3: Clean up slightly
Date: Mon, 8 Jul 2019 09:49:39 -0400 (EDT)

branch: scratch/iso8601
commit b00264de4e443d9a954eecb89a1fd1fa430bc639
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Clean up slightly
---
 lisp/calendar/iso8601.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el
index 4c66df1..991926f 100644
--- a/lisp/calendar/iso8601.el
+++ b/lisp/calendar/iso8601.el
@@ -200,15 +200,15 @@ Return the number of minutes."
 (defun iso8601-parse-duration (string)
   "Parse ISO 8601 durations on the form P3Y6M4DT12H30M5S."
   (cond
-   ((string-match 
"\\`P\\([0-9]+Y\\)?\\([0-9]+M\\)?\\([0-9]+D\\)?\\(T\\([0-9]+H\\)?\\([0-9]+M\\)?\\([0-9]+S\\)?\\)?\\'"
-                  string)
-    (when (> (length (match-string 0 string)) 2)
-      (iso8601--decoded-time :year (or (match-string 1 string) 0)
-                             :month (or (match-string 2 string) 0)
-                             :day (or (match-string 3 string) 0)
-                             :hour (or (match-string 5 string) 0)
-                             :minute (or (match-string 6 string) 0)
-                             :second (or (match-string 7 string) 0))))
+   ((and (string-match 
"\\`P\\([0-9]+Y\\)?\\([0-9]+M\\)?\\([0-9]+D\\)?\\(T\\([0-9]+H\\)?\\([0-9]+M\\)?\\([0-9]+S\\)?\\)?\\'"
+                       string)
+         (> (length (match-string 0 string)) 2))
+    (iso8601--decoded-time :year (or (match-string 1 string) 0)
+                           :month (or (match-string 2 string) 0)
+                           :day (or (match-string 3 string) 0)
+                           :hour (or (match-string 5 string) 0)
+                           :minute (or (match-string 6 string) 0)
+                           :second (or (match-string 7 string) 0)))
    ;; PnW: Weeks.
    ((string-match "\\`P\\([0-9]+\\)W\\'" string)
     (let ((weeks (string-to-number (match-string 1 string))))



reply via email to

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