diff options
Diffstat (limited to 'src/mcron/job-specifier.scm')
-rw-r--r-- | src/mcron/job-specifier.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mcron/job-specifier.scm b/src/mcron/job-specifier.scm index 5c8e171..e3b3391 100644 --- a/src/mcron/job-specifier.scm +++ b/src/mcron/job-specifier.scm @@ -60,12 +60,16 @@ go into the list. For example, (range 1 6 2) returns '(1 3 5)." ;; consisting of the smallest element of the NEXT-LIST, and the smallest ;; element larger than the CURRENT value. If an example of the latter ;; cannot be found, +INF.0 will be returned. + (define (exact-min a b) + ;; An implement of 'min' which preserves the exactness its arguments. + (if (< a b) a b)) + (let loop ((smallest (inf)) (closest+ (inf)) (lst next-list)) (match lst (() (cons smallest closest+)) ((time . rest) - (loop (min time smallest) - (if (> time current) (min time closest+) closest+) + (loop (exact-min time smallest) + (if (> time current) (exact-min time closest+) closest+) rest))))) (define (bump-time time value-list component higher-component |