From 395a75fcb8830fc2a4943907ea03393d263763d4 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Sun, 30 Jul 2023 11:19:34 -0600 Subject: [PATCH] fix time comparison --- node.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/node.go b/node.go index 77ca54b..496d862 100644 --- a/node.go +++ b/node.go @@ -140,20 +140,15 @@ func SoonestSignal(signals []QueuedSignal) (*QueuedSignal, <-chan time.Time) { var soonest_signal *QueuedSignal var soonest_time time.Time for _, signal := range(signals) { - if signal.Time.Compare(soonest_time) == -1 || soonest_signal == nil { + if signal.Time.Compare(soonest_time) == 1 || soonest_signal == nil { soonest_signal = &signal soonest_time = signal.Time } } if soonest_signal != nil { - print("SOONEST: ") - print(soonest_signal.Time.String()) - print(" : ") - println(soonest_signal.Signal.Type()) return soonest_signal, time.After(time.Until(soonest_signal.Time)) } else { - println("NONE_QUEUED") return nil, nil } }