Oops, mixed up a car with a cdr, which is never wise :)
[8sync.git] / loopy.scm
index ee1bc8121319943f49271b47b17e495ac92821de..5477af677f65d7e8464eb3af686e1a1b591484c8 100644 (file)
--- a/loopy.scm
+++ b/loopy.scm
@@ -174,12 +174,12 @@ Will produce (0 . 0) instead of a negative number, if needed."
 (define (time-minus time1 time2)
   (time-carry-correct
    (cons (- (car time1) (car time2))
-         (- (car time2) (cdr time2)))))
+         (- (cdr time2) (cdr time2)))))
 
 (define (time-plus time1 time2)
   (time-carry-correct
    (cons (+ (car time1) (car time2))
-         (+ (car time2) (cdr time2)))))
+         (+ (cdr time2) (cdr time2)))))
 
 
 (define-record-type <schedule>
@@ -356,11 +356,11 @@ Will produce (0 . 0) instead of a negative number, if needed."
         (cons 0 0))
        (soonest-time    ; ie, the agenda is non-empty
         (let* ((current-time (agenda-time agenda)))
-          (if (time<= (pk 'soonest-time soonest-time) (pk 'current-time current-time))
+          (if (time<= soonest-time current-time)
               ;; Well there's something due so let's select
               ;; (this avoids a (possible?) race condition chance)
               (cons 0 0)
-              (pk 'time-minus (time-minus soonest-time current-time)))))
+              (time-minus soonest-time current-time))))
        (else
         (cons #f #f)))))
   (define (do-select)