Refactor elisp/leap

This commit is contained in:
dwrz
2019-02-06 11:03:57 +00:00
parent 0b299c6d20
commit 4566ec687f
+3 -3
View File
@@ -8,9 +8,9 @@
(defun leap-year-p (year)
"Return whether a given year is a leap-year."
(when (= (mod year 4) 0)
(if (= (mod year 100) 0)
(when (= (mod year 400) 0) t)
(when (zerop (mod year 4))
(if (zerop (mod year 100))
(when (zerop (mod year 400)) t)
t)))
;;; leap.el ends here